diff options
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-snap.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index ad9b61f16c5e..f3759dd7828e 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c | |||
@@ -792,6 +792,9 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio, | |||
792 | if (!s->valid) | 792 | if (!s->valid) |
793 | return -EIO; | 793 | return -EIO; |
794 | 794 | ||
795 | if (unlikely(bio_barrier(bio))) | ||
796 | return -EOPNOTSUPP; | ||
797 | |||
795 | /* | 798 | /* |
796 | * Write to snapshot - higher level takes care of RW/RO | 799 | * Write to snapshot - higher level takes care of RW/RO |
797 | * flags so we should only get this if we are | 800 | * flags so we should only get this if we are |
@@ -1058,6 +1061,9 @@ static int origin_map(struct dm_target *ti, struct bio *bio, | |||
1058 | struct dm_dev *dev = (struct dm_dev *) ti->private; | 1061 | struct dm_dev *dev = (struct dm_dev *) ti->private; |
1059 | bio->bi_bdev = dev->bdev; | 1062 | bio->bi_bdev = dev->bdev; |
1060 | 1063 | ||
1064 | if (unlikely(bio_barrier(bio))) | ||
1065 | return -EOPNOTSUPP; | ||
1066 | |||
1061 | /* Only tell snapshots if this is a write */ | 1067 | /* Only tell snapshots if this is a write */ |
1062 | return (bio_rw(bio) == WRITE) ? do_origin(dev, bio) : 1; | 1068 | return (bio_rw(bio) == WRITE) ? do_origin(dev, bio) : 1; |
1063 | } | 1069 | } |