diff options
-rw-r--r-- | drivers/md/dm-thin.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index ce59824fb414..68694da0d21d 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c | |||
@@ -1245,7 +1245,10 @@ static void process_discard(struct thin_c *tc, struct bio *bio) | |||
1245 | 1245 | ||
1246 | cell_release_singleton(cell, bio); | 1246 | cell_release_singleton(cell, bio); |
1247 | cell_release_singleton(cell2, bio); | 1247 | cell_release_singleton(cell2, bio); |
1248 | remap_and_issue(tc, bio, lookup_result.block); | 1248 | if ((!lookup_result.shared) && pool->pf.discard_passdown) |
1249 | remap_and_issue(tc, bio, lookup_result.block); | ||
1250 | else | ||
1251 | bio_endio(bio, 0); | ||
1249 | } | 1252 | } |
1250 | break; | 1253 | break; |
1251 | 1254 | ||
@@ -2628,6 +2631,7 @@ static int thin_ctr(struct dm_target *ti, unsigned argc, char **argv) | |||
2628 | if (tc->pool->pf.discard_enabled) { | 2631 | if (tc->pool->pf.discard_enabled) { |
2629 | ti->discards_supported = 1; | 2632 | ti->discards_supported = 1; |
2630 | ti->num_discard_requests = 1; | 2633 | ti->num_discard_requests = 1; |
2634 | ti->discard_zeroes_data_unsupported = 1; | ||
2631 | } | 2635 | } |
2632 | 2636 | ||
2633 | dm_put(pool_md); | 2637 | dm_put(pool_md); |