diff options
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r-- | drivers/md/dm.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 2717a355dc5b..75bd2fd8575e 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -802,6 +802,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]); |