If rdev became blocked because the unack badblocks, it did not exec md_wait_for_blocked_rdev in handle_stripe().So the rdev->nr_pending did not decrease.So rdev did not remove because the wrong nr_pending. Signed-off-by: majianpeng <majianpeng@xxxxxxxxx> --- drivers/md/raid5.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index d267672..ed63261 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -3582,7 +3582,8 @@ static void handle_stripe(struct stripe_head *sh) finish: /* wait for this device to become unblocked */ - if (conf->mddev->external && unlikely(s.blocked_rdev)) + if (unlikely(s.blocked_rdev) && (conf->mddev->external || + test_bit(BlockedBadBlocks, &(s.blocked_rdev->flags)))) md_wait_for_blocked_rdev(s.blocked_rdev, conf->mddev); if (s.handle_bad_blocks) -- 1.7.5.4 ?韬{.n?????%??檩??w?{.n???{炳盯w???塄}?财??j:+v??????2??璀??摺?囤??z夸z罐?+?????w棹f