Commit 7cee6d4e authored by Yufen Yu's avatar Yufen Yu Committed by Song Liu

md/raid10: end bio when the device faulty

Just like raid1, we do not queue write error bio to retry write
and acknowlege badblocks, when the device is faulty.
Signed-off-by: default avatarYufen Yu <yuyufen@huawei.com>
Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
parent eeba6809
...@@ -465,19 +465,21 @@ static void raid10_end_write_request(struct bio *bio) ...@@ -465,19 +465,21 @@ static void raid10_end_write_request(struct bio *bio)
if (test_bit(FailFast, &rdev->flags) && if (test_bit(FailFast, &rdev->flags) &&
(bio->bi_opf & MD_FAILFAST)) { (bio->bi_opf & MD_FAILFAST)) {
md_error(rdev->mddev, rdev); md_error(rdev->mddev, rdev);
if (!test_bit(Faulty, &rdev->flags)) }
/* This is the only remaining device,
* We need to retry the write without /*
* FailFast * When the device is faulty, it is not necessary to
* handle write error.
* For failfast, this is the only remaining device,
* We need to retry the write without FailFast.
*/ */
if (!test_bit(Faulty, &rdev->flags))
set_bit(R10BIO_WriteError, &r10_bio->state); set_bit(R10BIO_WriteError, &r10_bio->state);
else { else {
r10_bio->devs[slot].bio = NULL; r10_bio->devs[slot].bio = NULL;
to_put = bio; to_put = bio;
dec_rdev = 1; dec_rdev = 1;
} }
} else
set_bit(R10BIO_WriteError, &r10_bio->state);
} }
} else { } else {
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment