Skip to content

Commit

Permalink
dm cache: always split discards on cache block boundaries
Browse files Browse the repository at this point in the history
The DM cache target cannot cope with discards that span multiple cache
blocks, so each discard bio that spans more than one cache block must
get split by the DM core.

Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Acked-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org # v3.9+
  • Loading branch information
Heinz Mauelshagen authored and Mike Snitzer committed May 27, 2014
1 parent 80c5789 commit f1daa83
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/md/dm-cache-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -2178,6 +2178,8 @@ static int cache_create(struct cache_args *ca, struct cache **result)
ti->num_discard_bios = 1;
ti->discards_supported = true;
ti->discard_zeroes_data_unsupported = true;
/* Discard bios must be split on a block boundary */
ti->split_discard_bios = true;

cache->features = ca->features;
ti->per_bio_data_size = get_per_bio_data_size(cache);
Expand Down

0 comments on commit f1daa83

Please sign in to comment.