Skip to content

Commit 9283d8c

Browse files
committed
md/raid5: never wait for bad-block acks on failed device.
Once a device is failed we really want to completely ignore it. It should go away soon anyway. In particular the presence of bad blocks on it should not cause us to block as we won't be trying to write there anyway. So as soon as we can check if a device is Faulty, do so and pretend that it is already gone if it is Faulty. Signed-off-by: NeilBrown <[email protected]>
1 parent 8bd2f0a commit 9283d8c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/md/raid5.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3036,6 +3036,8 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s)
30363036
if (dev->written)
30373037
s->written++;
30383038
rdev = rcu_dereference(conf->disks[i].rdev);
3039+
if (rdev && test_bit(Faulty, &rdev->flags))
3040+
rdev = NULL;
30393041
if (rdev) {
30403042
is_bad = is_badblock(rdev, sh->sector, STRIPE_SECTORS,
30413043
&first_bad, &bad_sectors);
@@ -3063,7 +3065,7 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s)
30633065
}
30643066
} else if (test_bit(In_sync, &rdev->flags))
30653067
set_bit(R5_Insync, &dev->flags);
3066-
else if (!test_bit(Faulty, &rdev->flags)) {
3068+
else {
30673069
/* in sync if before recovery_offset */
30683070
if (sh->sector + STRIPE_SECTORS <= rdev->recovery_offset)
30693071
set_bit(R5_Insync, &dev->flags);

0 commit comments

Comments
 (0)