Bug 918647 - dm-thin: Discarding blocks shared between thin devices may cause data loss
Summary: dm-thin: Discarding blocks shared between thin devices may cause data loss
Keywords:
Status: CLOSED DUPLICATE of bug 922931
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel
Version: 6.4
Hardware: All
OS: All
urgent
urgent
Target Milestone: pre-dev-freeze
: 6.5
Assignee: Mike Snitzer
QA Contact: yanfu,wang
URL:
Whiteboard:
Depends On:
Blocks: 919138
TreeView+ depends on / blocked
 
Reported: 2013-03-06 16:31 UTC by Jim Minter
Modified: 2013-09-19 19:42 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Known Issue
Doc Text:
Thin provisioning uses reference counts to indicate that data is shared between a thin volume and snapshots of the thin volume. There is a known issue with the way reference counts are managed in the case when a discard is issued to a thin volume that has snapshots. Creating snapshots of a thin volume and then issuing discards to the thin volume can therefore result in data loss in the snapshot volumes. Users are strongly encouraged to disable discard support on the thin-pool for the time being. To do so using lvm2 while the pool is offline, use the lvchange --discard ignore <pool> command. Any discards that might be issued to thin volumes will be ignored.
Clone Of:
: 919138 (view as bug list)
Environment:
Last Closed: 2013-09-19 19:42:35 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Jim Minter 2013-03-06 16:31:56 UTC
Bug originally reported at http://www.redhat.com/archives/dm-devel/2013-March/msg00033.html , problem relates to issuing the BLKDISCARD ioctl to a thin volume.  If I create a thin volume, fill it with data, snapshot it, then call BLKDISCARD on the thin volume, it looks like the kernel doesn't take into account the fact that the underlying blocks are shared with the snapshot, and just goes ahead and discards them.  This appears to then leave the metadata in an inconsistent state.

Fix at https://github.com/jthornber/linux-2.6/commit/a42dfef751cb666d3274346c07dff655cb40cc5a ("Fix a bug in dm_btree_remove that could leave leaf values with incorrect reference counts").

Comment 1 Zdenek Kabelac 2013-03-07 08:13:48 UTC
Are we going add 'workaround' support for this issue in lvm2 tools - to disable usage of discard for thinp targets prior some specific version ?

If so - how do we detect target with this bug - will there be version number increase?


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