aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
authorGuoqing Jiang <gqjiang@suse.com>2017-07-21 04:33:44 -0400
committerShaohua Li <shli@fb.com>2017-07-21 16:16:52 -0400
commit6308d8e3d42bea15461c696df1ad74c2944b5c23 (patch)
tree1e30879970b4311e7cfa75b2e90e0192173a1ef4 /drivers/md/raid1.c
parent16d56e2fcc1fc15b981369653c3b41d7ff0b443d (diff)
md: simplify code with bio_io_error
Since bio_io_error sets bi_status to BLK_STS_IOERR, and calls bio_endio, so we can use it directly. And as mentioned by Shaohua, there are also two places in raid5.c can use bio_io_error either. Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r--drivers/md/raid1.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 1d235cc8b402..f50958ded9f0 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -790,8 +790,7 @@ static void flush_bio_list(struct r1conf *conf, struct bio *bio)
790 bio->bi_next = NULL; 790 bio->bi_next = NULL;
791 bio->bi_bdev = rdev->bdev; 791 bio->bi_bdev = rdev->bdev;
792 if (test_bit(Faulty, &rdev->flags)) { 792 if (test_bit(Faulty, &rdev->flags)) {
793 bio->bi_status = BLK_STS_IOERR; 793 bio_io_error(bio);
794 bio_endio(bio);
795 } else if (unlikely((bio_op(bio) == REQ_OP_DISCARD) && 794 } else if (unlikely((bio_op(bio) == REQ_OP_DISCARD) &&
796 !blk_queue_discard(bdev_get_queue(bio->bi_bdev)))) 795 !blk_queue_discard(bdev_get_queue(bio->bi_bdev))))
797 /* Just ignore it */ 796 /* Just ignore it */