Bug 240476

Summary: Disk accounting twice with LVM Snapshots
Product: Red Hat Enterprise Linux 5 Reporter: Mike Fedyk <mfedyk>
Component: kernelAssignee: Milan Broz <mbroz>
Status: CLOSED NOTABUG QA Contact: Martin Jenner <mjenner>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.0CC: agk, dwysocha, dzickus, mauelshagen-do-not-use, mbroz, prockai, pvrabec
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
URL: http://lists.centos.org/pipermail/centos/2007-May/081227.html
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-11-02 13:46:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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):
2.6.18-8.1.1.el5xen

How reproducible:
Always

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.