From 600497013687516153cb82637acfe56f7eb9308a Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Fri, 27 Jul 2012 15:08:06 +0100 Subject: dm thin: avoid unnecessarily breaking sharing for flushes There's no need to break sharing, triggering a copy, for a write that has no data (i.e. a flush). Signed-off-by: Joe Thornber Signed-off-by: Mike Snitzer Signed-off-by: Alasdair G Kergon --- drivers/md/dm-thin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/md') diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 423df92f1c1..7510cb3d571 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c @@ -1315,7 +1315,7 @@ static void process_shared_bio(struct thin_c *tc, struct bio *bio, if (bio_detain(pool->prison, &key, bio, &cell)) return; - if (bio_data_dir(bio) == WRITE) + if (bio_data_dir(bio) == WRITE && bio->bi_size) break_sharing(tc, bio, block, &key, lookup_result, cell); else { struct dm_thin_endio_hook *h = dm_get_mapinfo(bio)->ptr; -- cgit v1.2.3-70-g09d2