diff options
author | Joe Thornber <ejt@redhat.com> | 2013-12-17 12:09:40 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-13 13:48:01 -0800 |
commit | 614319dfb0fb5da7fd2f96eb06df96bd3a04cbdd (patch) | |
tree | fa2599b2c36b6cc187ffc9f6c6959a213c569e14 /sound/soc/s6000/Makefile | |
parent | 42e0de9d0e77debb0a34024729cd34068af68bd8 (diff) | |
download | linux-3.10-614319dfb0fb5da7fd2f96eb06df96bd3a04cbdd.tar.gz linux-3.10-614319dfb0fb5da7fd2f96eb06df96bd3a04cbdd.tar.bz2 linux-3.10-614319dfb0fb5da7fd2f96eb06df96bd3a04cbdd.zip |
dm thin: fix discard support to a previously shared block
commit 19fa1a6756ed9e92daa9537c03b47d6b55cc2316 upstream.
If a snapshot is created and later deleted the origin dm_thin_device's
snapshotted_time will have been updated to reflect the snapshot's
creation time. The 'shared' flag in the dm_thin_lookup_result struct
returned from dm_thin_find_block() is an approximation based on
snapshotted_time -- this is done to avoid 0(n), or worse, time
complexity. In this case, the shared flag would be true.
But because the 'shared' flag reflects an approximation a block can be
incorrectly assumed to be shared (e.g. false positive for 'shared'
because the snapshot no longer exists). This could result in discards
issued to a thin device not being passed down to the pool's underlying
data device.
To fix this we double check that a thin block is really still in-use
after a mapping is removed using dm_pool_block_is_used(). If the
reference count for a block is now zero the discard is allowed to be
passed down.
Also add a 'definitely_not_shared' member to the dm_thin_new_mapping
structure -- reflects that the 'shared' flag in the response from
dm_thin_find_block() can only be held as definitive if false is
returned.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1043527
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/soc/s6000/Makefile')
0 files changed, 0 insertions, 0 deletions