Commit 60049701 authored by Joe Thornber's avatar Joe Thornber Committed by Alasdair G Kergon

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: default avatarJoe Thornber <ejt@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent 905386f8
......@@ -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;
......
Markdown is supported
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