Skip to content

Commit 649bfec

Browse files
YuKuai-huaweiliu-song-6
authored andcommitted
md/raid5: don't set Faulty rdev for blocked_rdev
Faulty rdev should never be accessed anymore, hence there is no point to wait for bad block to be acknowledged in this case while handling write request. Signed-off-by: Yu Kuai <[email protected]> Tested-by: Mariusz Tkaczyk <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
1 parent d419284 commit 649bfec

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

drivers/md/raid5.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4724,14 +4724,13 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s)
47244724
if (rdev) {
47254725
is_bad = rdev_has_badblock(rdev, sh->sector,
47264726
RAID5_STRIPE_SECTORS(conf));
4727-
if (s->blocked_rdev == NULL
4728-
&& (test_bit(Blocked, &rdev->flags)
4729-
|| is_bad < 0)) {
4727+
if (s->blocked_rdev == NULL) {
47304728
if (is_bad < 0)
4731-
set_bit(BlockedBadBlocks,
4732-
&rdev->flags);
4733-
s->blocked_rdev = rdev;
4734-
atomic_inc(&rdev->nr_pending);
4729+
set_bit(BlockedBadBlocks, &rdev->flags);
4730+
if (rdev_blocked(rdev)) {
4731+
s->blocked_rdev = rdev;
4732+
atomic_inc(&rdev->nr_pending);
4733+
}
47354734
}
47364735
}
47374736
clear_bit(R5_Insync, &dev->flags);

0 commit comments

Comments
 (0)