aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-snap.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-snap.c')
-rw-r--r--drivers/md/dm-snap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 5974d3094d97..eed210152b75 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -1587,7 +1587,7 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio,
1587 chunk_t chunk; 1587 chunk_t chunk;
1588 struct dm_snap_pending_exception *pe = NULL; 1588 struct dm_snap_pending_exception *pe = NULL;
1589 1589
1590 if (unlikely(bio_empty_barrier(bio))) { 1590 if (bio->bi_rw & REQ_FLUSH) {
1591 bio->bi_bdev = s->cow->bdev; 1591 bio->bi_bdev = s->cow->bdev;
1592 return DM_MAPIO_REMAPPED; 1592 return DM_MAPIO_REMAPPED;
1593 } 1593 }
@@ -1691,7 +1691,7 @@ static int snapshot_merge_map(struct dm_target *ti, struct bio *bio,
1691 int r = DM_MAPIO_REMAPPED; 1691 int r = DM_MAPIO_REMAPPED;
1692 chunk_t chunk; 1692 chunk_t chunk;
1693 1693
1694 if (unlikely(bio_empty_barrier(bio))) { 1694 if (bio->bi_rw & REQ_FLUSH) {
1695 if (!map_context->target_request_nr) 1695 if (!map_context->target_request_nr)
1696 bio->bi_bdev = s->origin->bdev; 1696 bio->bi_bdev = s->origin->bdev;
1697 else 1697 else
@@ -2135,7 +2135,7 @@ static int origin_map(struct dm_target *ti, struct bio *bio,
2135 struct dm_dev *dev = ti->private; 2135 struct dm_dev *dev = ti->private;
2136 bio->bi_bdev = dev->bdev; 2136 bio->bi_bdev = dev->bdev;
2137 2137
2138 if (unlikely(bio_empty_barrier(bio))) 2138 if (bio->bi_rw & REQ_FLUSH)
2139 return DM_MAPIO_REMAPPED; 2139 return DM_MAPIO_REMAPPED;
2140 2140
2141 /* Only tell snapshots if this is a write */ 2141 /* Only tell snapshots if this is a write */