diff options
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid1.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 532d04077301..b8c13c897ccb 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -753,18 +753,24 @@ static int make_request(request_queue_t *q, struct bio * bio) | |||
753 | const int rw = bio_data_dir(bio); | 753 | const int rw = bio_data_dir(bio); |
754 | int do_barriers; | 754 | int do_barriers; |
755 | 755 | ||
756 | if (unlikely(!mddev->barriers_work && bio_barrier(bio))) { | ||
757 | bio_endio(bio, bio->bi_size, -EOPNOTSUPP); | ||
758 | return 0; | ||
759 | } | ||
760 | |||
761 | /* | 756 | /* |
762 | * Register the new request and wait if the reconstruction | 757 | * Register the new request and wait if the reconstruction |
763 | * thread has put up a bar for new requests. | 758 | * thread has put up a bar for new requests. |
764 | * Continue immediately if no resync is active currently. | 759 | * Continue immediately if no resync is active currently. |
760 | * We test barriers_work *after* md_write_start as md_write_start | ||
761 | * may cause the first superblock write, and that will check out | ||
762 | * if barriers work. | ||
765 | */ | 763 | */ |
764 | |||
766 | md_write_start(mddev, bio); /* wait on superblock update early */ | 765 | md_write_start(mddev, bio); /* wait on superblock update early */ |
767 | 766 | ||
767 | if (unlikely(!mddev->barriers_work && bio_barrier(bio))) { | ||
768 | if (rw == WRITE) | ||
769 | md_write_end(mddev); | ||
770 | bio_endio(bio, bio->bi_size, -EOPNOTSUPP); | ||
771 | return 0; | ||
772 | } | ||
773 | |||
768 | wait_barrier(conf); | 774 | wait_barrier(conf); |
769 | 775 | ||
770 | disk_stat_inc(mddev->gendisk, ios[rw]); | 776 | disk_stat_inc(mddev->gendisk, ios[rw]); |