Skip to content
Commit d132cc6d authored by Mike Snitzer's avatar Mike Snitzer
Browse files

dm cache: prevent corruption caused by discard_block_size > cache_block_size



If the discard block size is larger than the cache block size we will
not properly quiesce IO to a region that is about to be discarded.  This
results in a race between a cache migration where no copy is needed, and
a write to an adjacent cache block that's within the same large discard
block.

Workaround this by limiting the discard_block_size to cache_block_size.
Also limit the max_discard_sectors to cache_block_size.

A more comprehensive fix that introduces range locking support in the
bio_prison and proper quiescing of a discard range that spans multiple
cache blocks is already in development.

Reported-by: default avatarMorgan Mears <Morgan.Mears@netapp.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Acked-by: default avatarJoe Thornber <ejt@redhat.com>
Acked-by: default avatarHeinz Mauelshagen <heinzm@redhat.com>
Cc: stable@vger.kernel.org
parent 428e4698
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment