Skip to content

Commit 5ba0393

Browse files
wsy2220liu-song-6
authored andcommitted
md/raid10: properly indicate failure when ending a failed write request
Similar to [1], this patch fixes the same bug in raid10. Also cleanup the comments. [1] commit 2417b98 ("md/raid1: properly indicate failure when ending a failed write request") Cc: [email protected] Fixes: 7cee6d4 ("md/raid10: end bio when the device faulty") Signed-off-by: Wei Shuyu <[email protected]> Acked-by: Guoqing Jiang <[email protected]> Signed-off-by: Song Liu <[email protected]>
1 parent 2705dfb commit 5ba0393

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

drivers/md/raid1.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,6 @@ static void raid1_end_write_request(struct bio *bio)
472472
/*
473473
* When the device is faulty, it is not necessary to
474474
* handle write error.
475-
* For failfast, this is the only remaining device,
476-
* We need to retry the write without FailFast.
477475
*/
478476
if (!test_bit(Faulty, &rdev->flags))
479477
set_bit(R1BIO_WriteError, &r1_bio->state);

drivers/md/raid10.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,12 +469,12 @@ static void raid10_end_write_request(struct bio *bio)
469469
/*
470470
* When the device is faulty, it is not necessary to
471471
* handle write error.
472-
* For failfast, this is the only remaining device,
473-
* We need to retry the write without FailFast.
474472
*/
475473
if (!test_bit(Faulty, &rdev->flags))
476474
set_bit(R10BIO_WriteError, &r10_bio->state);
477475
else {
476+
/* Fail the request */
477+
set_bit(R10BIO_Degraded, &r10_bio->state);
478478
r10_bio->devs[slot].bio = NULL;
479479
to_put = bio;
480480
dec_rdev = 1;

0 commit comments

Comments
 (0)