diff options
author | NeilBrown <neilb@cse.unsw.edu.au> | 2005-09-09 19:23:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 19:39:09 -0400 |
commit | e5dcdd80a60627371f40797426273048630dc8ca (patch) | |
tree | 1621f68394ceaa4da86d89c6da3b93fd306415fc /drivers | |
parent | 3ec67ac1a399d576d48b0736096bcce7721fe3cf (diff) |
[PATCH] md: fail IO request to md that require a barrier.
md does not yet support BIO_RW_BARRIER, so be honest about it and fail
(-EOPNOTSUPP) any such requests.
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/linear.c | 5 | ||||
-rw-r--r-- | drivers/md/multipath.c | 5 | ||||
-rw-r--r-- | drivers/md/raid0.c | 5 | ||||
-rw-r--r-- | drivers/md/raid1.c | 4 | ||||
-rw-r--r-- | drivers/md/raid10.c | 5 | ||||
-rw-r--r-- | drivers/md/raid5.c | 5 | ||||
-rw-r--r-- | drivers/md/raid6main.c | 5 |
7 files changed, 34 insertions, 0 deletions
diff --git a/drivers/md/linear.c b/drivers/md/linear.c index 8d740013d74d..4991ba543368 100644 --- a/drivers/md/linear.c +++ b/drivers/md/linear.c | |||
@@ -238,6 +238,11 @@ static int linear_make_request (request_queue_t *q, struct bio *bio) | |||
238 | dev_info_t *tmp_dev; | 238 | dev_info_t *tmp_dev; |
239 | sector_t block; | 239 | sector_t block; |
240 | 240 | ||
241 | if (unlikely(bio_barrier(bio))) { | ||
242 | bio_endio(bio, bio->bi_size, -EOPNOTSUPP); | ||
243 | return 0; | ||
244 | } | ||
245 | |||
241 | if (bio_data_dir(bio)==WRITE) { | 246 | if (bio_data_dir(bio)==WRITE) { |
242 | disk_stat_inc(mddev->gendisk, writes); | 247 | disk_stat_inc(mddev->gendisk, writes); |
243 | disk_stat_add(mddev->gendisk, write_sectors, bio_sectors(bio)); | 248 | disk_stat_add(mddev->gendisk, write_sectors, bio_sectors(bio)); |
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c index 2d2ca7fa0265..286342375fb7 100644 --- a/drivers/md/multipath.c +++ b/drivers/md/multipath.c | |||
@@ -169,6 +169,11 @@ static int multipath_make_request (request_queue_t *q, struct bio * bio) | |||
169 | struct multipath_bh * mp_bh; | 169 | struct multipath_bh * mp_bh; |
170 | struct multipath_info *multipath; | 170 | struct multipath_info *multipath; |
171 | 171 | ||
172 | if (unlikely(bio_barrier(bio))) { | ||
173 | bio_endio(bio, bio->bi_size, -EOPNOTSUPP); | ||
174 | return 0; | ||
175 | } | ||
176 | |||
172 | mp_bh = mempool_alloc(conf->pool, GFP_NOIO); | 177 | mp_bh = mempool_alloc(conf->pool, GFP_NOIO); |
173 | 178 | ||
174 | mp_bh->master_bio = bio; | 179 | mp_bh->master_bio = bio; |
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index 2120710172c5..f6757259ce7f 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c | |||
@@ -404,6 +404,11 @@ static int raid0_make_request (request_queue_t *q, struct bio *bio) | |||
404 | unsigned long chunk; | 404 | unsigned long chunk; |
405 | sector_t block, rsect; | 405 | sector_t block, rsect; |
406 | 406 | ||
407 | if (unlikely(bio_barrier(bio))) { | ||
408 | bio_endio(bio, bio->bi_size, -EOPNOTSUPP); | ||
409 | return 0; | ||
410 | } | ||
411 | |||
407 | if (bio_data_dir(bio)==WRITE) { | 412 | if (bio_data_dir(bio)==WRITE) { |
408 | disk_stat_inc(mddev->gendisk, writes); | 413 | disk_stat_inc(mddev->gendisk, writes); |
409 | disk_stat_add(mddev->gendisk, write_sectors, bio_sectors(bio)); | 414 | disk_stat_add(mddev->gendisk, write_sectors, bio_sectors(bio)); |
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 51d9645ed09c..ace41c571aeb 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -555,6 +555,10 @@ static int make_request(request_queue_t *q, struct bio * bio) | |||
555 | unsigned long flags; | 555 | unsigned long flags; |
556 | struct bio_list bl; | 556 | struct bio_list bl; |
557 | 557 | ||
558 | if (unlikely(bio_barrier(bio))) { | ||
559 | bio_endio(bio, bio->bi_size, -EOPNOTSUPP); | ||
560 | return 0; | ||
561 | } | ||
558 | 562 | ||
559 | /* | 563 | /* |
560 | * Register the new request and wait if the reconstruction | 564 | * Register the new request and wait if the reconstruction |
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 7239079203ec..5e0b333793d5 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -669,6 +669,11 @@ static int make_request(request_queue_t *q, struct bio * bio) | |||
669 | int i; | 669 | int i; |
670 | int chunk_sects = conf->chunk_mask + 1; | 670 | int chunk_sects = conf->chunk_mask + 1; |
671 | 671 | ||
672 | if (unlikely(bio_barrier(bio))) { | ||
673 | bio_endio(bio, bio->bi_size, -EOPNOTSUPP); | ||
674 | return 0; | ||
675 | } | ||
676 | |||
672 | /* If this request crosses a chunk boundary, we need to | 677 | /* If this request crosses a chunk boundary, we need to |
673 | * split it. This will only happen for 1 PAGE (or less) requests. | 678 | * split it. This will only happen for 1 PAGE (or less) requests. |
674 | */ | 679 | */ |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 43f231a467d5..ed859e08d600 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -1411,6 +1411,11 @@ static int make_request (request_queue_t *q, struct bio * bi) | |||
1411 | sector_t logical_sector, last_sector; | 1411 | sector_t logical_sector, last_sector; |
1412 | struct stripe_head *sh; | 1412 | struct stripe_head *sh; |
1413 | 1413 | ||
1414 | if (unlikely(bio_barrier(bi))) { | ||
1415 | bio_endio(bi, bi->bi_size, -EOPNOTSUPP); | ||
1416 | return 0; | ||
1417 | } | ||
1418 | |||
1414 | md_write_start(mddev, bi); | 1419 | md_write_start(mddev, bi); |
1415 | 1420 | ||
1416 | if (bio_data_dir(bi)==WRITE) { | 1421 | if (bio_data_dir(bi)==WRITE) { |
diff --git a/drivers/md/raid6main.c b/drivers/md/raid6main.c index 495dee1d1e83..09cb7272c09f 100644 --- a/drivers/md/raid6main.c +++ b/drivers/md/raid6main.c | |||
@@ -1570,6 +1570,11 @@ static int make_request (request_queue_t *q, struct bio * bi) | |||
1570 | sector_t logical_sector, last_sector; | 1570 | sector_t logical_sector, last_sector; |
1571 | struct stripe_head *sh; | 1571 | struct stripe_head *sh; |
1572 | 1572 | ||
1573 | if (unlikely(bio_barrier(bi))) { | ||
1574 | bio_endio(bi, bi->bi_size, -EOPNOTSUPP); | ||
1575 | return 0; | ||
1576 | } | ||
1577 | |||
1573 | md_write_start(mddev, bi); | 1578 | md_write_start(mddev, bi); |
1574 | 1579 | ||
1575 | if (bio_data_dir(bi)==WRITE) { | 1580 | if (bio_data_dir(bi)==WRITE) { |