Bug 240476 - Disk accounting twice with LVM Snapshots
Summary: Disk accounting twice with LVM Snapshots
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel   
(Show other bugs)
Version: 5.0
Hardware: i386
OS: Linux
Target Milestone: ---
: ---
Assignee: Milan Broz
QA Contact: Martin Jenner
URL: http://lists.centos.org/pipermail/cen...
Depends On:
TreeView+ depends on / blocked
Reported: 2007-05-17 19:25 UTC by Mike Fedyk
Modified: 2013-03-01 04:05 UTC (History)
7 users (show)

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

Attachments (Terms of Use)

Description Mike Fedyk 2007-05-17 19:25:49 UTC
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 19:37:59 UTC
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 13:46:12 UTC
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.