Bug 240476 - Disk accounting twice with LVM Snapshots
Disk accounting twice with LVM Snapshots
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Milan Broz
Martin Jenner
Depends On:
  Show dependency treegraph
Reported: 2007-05-17 15:25 EDT by Mike Fedyk
Modified: 2013-02-28 23:05 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-11-02 09:46:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Mike Fedyk 2007-05-17 15:25:49 EDT
Description of problem:
I was reading a lot of data from one LVM logical volume and wanted to 
watch the disk statistics with iostat today.  To my surprise, I was 
seeing the same activity on two logical volumes (LV) and the physical 
disk containing the two.

A little investigation showed that one LV was a snapshot of the other, 
and I was reading from one of the snapshots.

While I understand that the two LVs share some common Logical Extents 
(LE), I believe it is a bug that the disk statistics show the activity 
on both logical volumes.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Create LVM LV
2. Create snapshot of LV
3. Read from LV
4. Watch iostat -x or /proc/diskstats
Actual results:
Disk activity is accounted to snapshot and original LV

Expected results:
Disk activity originating on a snapshot should not be accounted to the LV it is
a snapshot of.  IOW, only account disk activity originating on one LV within
itself, even if there are shared Logial Extents (LE).

Additional info:
Comment 1 Mike Fedyk 2007-05-17 15:37:59 EDT
Steps to reproduce should read:
1. Create LVM LV
2. Create snapshot of LV
3. Read from snapshot
4. Watch iostat -x or /proc/diskstats
Comment 2 Milan Broz 2007-11-02 09:46:12 EDT
Snapshot (copy-on-write) volume contains only changed blocks (which differ from
origin Logical Volume). If you are reading data from snapshot, not changed
blocks are read (redirected) from origin volume.

So there are real and legitimate io operations on origin and copy-on-write
volume, iostat should count them.

Note You need to log in before you can comment on or make changes to this bug.