linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] md/raid5:Add "BlockedBadBlocks" flag when waitting rdev to be unlocked.
@ 2012-06-18  3:13 majianpeng
  2012-06-27  3:45 ` NeilBrown
  0 siblings, 1 reply; 3+ messages in thread
From: majianpeng @ 2012-06-18  3:13 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-raid

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@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-06-27  3:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-18  3:13 [PATCH] md/raid5:Add "BlockedBadBlocks" flag when waitting rdev to be unlocked majianpeng
2012-06-27  3:45 ` NeilBrown
2012-06-27  3:55   ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).