dm cache: always split discards on cache block boundaries
authorHeinz Mauelshagen <[email protected]>
Fri, 23 May 2014 18:10:01 +0000 (14:10 -0400)
committerMike Snitzer <[email protected]>
Tue, 27 May 2014 14:33:05 +0000 (10:33 -0400)
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 <[email protected]>
Acked-by: Joe Thornber <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
Cc: [email protected] # v3.9+
drivers/md/dm-cache-target.c

index 9380be7b18954b9308ed42abe5fafa2f87c0f76a..5f054c44b485f27dec03bb5bed4c13e95dff18db 100644 (file)
@@ -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);