summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorJoe Thornber2012-07-27 16:08:06 +0200
committerAlasdair G Kergon2012-07-27 16:08:06 +0200
commit600497013687516153cb82637acfe56f7eb9308a (patch)
treed44382be55c68208ba7344dfaca8ade10e87c0d5 /drivers/md
parentdm thin: fix memory leak in process_prepared_mapping error paths (diff)
downloadkernel-qcow2-linux-600497013687516153cb82637acfe56f7eb9308a.tar.gz
kernel-qcow2-linux-600497013687516153cb82637acfe56f7eb9308a.tar.xz
kernel-qcow2-linux-600497013687516153cb82637acfe56f7eb9308a.zip
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 <ejt@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-thin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index 423df92f1c19..7510cb3d571c 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;