From 50cd19175b068538c21f6c627242b60204f106f0 Mon Sep 17 00:00:00 2001 From: Stefan Bader Date: Thu, 12 Jul 2007 17:28:33 +0100 Subject: [PATCH] --- yaml --- r: 59286 b: refs/heads/master c: 07a83c47cfc00ba5f0f090ccddd3a0703be0eec9 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/md/dm-crypt.c | 3 --- trunk/drivers/md/dm-mpath.c | 3 --- trunk/drivers/md/dm-snap.c | 6 ------ trunk/drivers/md/dm.c | 9 +++++++++ 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index 2bb5d663bc35..6c8e5515cbce 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 943317efdbc295e8a28df3f5cbd549d066ee8b4a +refs/heads/master: 07a83c47cfc00ba5f0f090ccddd3a0703be0eec9 diff --git a/trunk/drivers/md/dm-crypt.c b/trunk/drivers/md/dm-crypt.c index ece7c7c4cdbb..ba952a032598 100644 --- a/trunk/drivers/md/dm-crypt.c +++ b/trunk/drivers/md/dm-crypt.c @@ -941,9 +941,6 @@ static int crypt_map(struct dm_target *ti, struct bio *bio, struct crypt_config *cc = ti->private; struct dm_crypt_io *io; - if (bio_barrier(bio)) - return -EOPNOTSUPP; - io = mempool_alloc(cc->io_pool, GFP_NOIO); io->target = ti; io->base_bio = bio; diff --git a/trunk/drivers/md/dm-mpath.c b/trunk/drivers/md/dm-mpath.c index fc6c1021178d..d6ca9d0a6fd1 100644 --- a/trunk/drivers/md/dm-mpath.c +++ b/trunk/drivers/md/dm-mpath.c @@ -798,9 +798,6 @@ static int multipath_map(struct dm_target *ti, struct bio *bio, struct dm_mpath_io *mpio; struct multipath *m = (struct multipath *) ti->private; - if (bio_barrier(bio)) - return -EOPNOTSUPP; - mpio = mempool_alloc(m->mpio_pool, GFP_NOIO); dm_bio_record(&mpio->details, bio); diff --git a/trunk/drivers/md/dm-snap.c b/trunk/drivers/md/dm-snap.c index 854891d07b59..83ddbfe6b8a4 100644 --- a/trunk/drivers/md/dm-snap.c +++ b/trunk/drivers/md/dm-snap.c @@ -889,9 +889,6 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio, if (!s->valid) return -EIO; - if (unlikely(bio_barrier(bio))) - return -EOPNOTSUPP; - /* FIXME: should only take write lock if we need * to copy an exception */ down_write(&s->lock); @@ -1162,9 +1159,6 @@ static int origin_map(struct dm_target *ti, struct bio *bio, struct dm_dev *dev = ti->private; bio->bi_bdev = dev->bdev; - if (unlikely(bio_barrier(bio))) - return -EOPNOTSUPP; - /* Only tell snapshots if this is a write */ return (bio_rw(bio) == WRITE) ? do_origin(dev, bio) : DM_MAPIO_REMAPPED; } diff --git a/trunk/drivers/md/dm.c b/trunk/drivers/md/dm.c index b5e56af8f85a..f4f7d35561ab 100644 --- a/trunk/drivers/md/dm.c +++ b/trunk/drivers/md/dm.c @@ -800,6 +800,15 @@ static int dm_request(request_queue_t *q, struct bio *bio) int rw = bio_data_dir(bio); struct mapped_device *md = q->queuedata; + /* + * There is no use in forwarding any barrier request since we can't + * guarantee it is (or can be) handled by the targets correctly. + */ + if (unlikely(bio_barrier(bio))) { + bio_endio(bio, bio->bi_size, -EOPNOTSUPP); + return 0; + } + down_read(&md->io_lock); disk_stat_inc(dm_disk(md), ios[rw]);