Thread (5 messages) 5 messages, 2 authors, 2013-03-04

Re: [PATCH 1/4] md/raid5: Reduce one write-operation when handle badsector

From: NeilBrown <hidden>
Date: 2013-03-04 01:43:30

On Thu, 28 Feb 2013 15:51:01 +0800 majianpeng [off-list ref] wrote:
For badsector,it took two steps:rewrite and reread.So for
write-operation,it make no sense to rewrite after write-operation.
Please please please please please try to explain yourself better.

This patch doesn't make any sense.  The write succeeded.  We set the MadeGood
flag so that later code will remove the block from the bad-block list.
There will be no re-read or re-write.

NeilBrown

quoted hunk ↗ jump to hunk
Signed-off-by: Jianpeng Ma <redacted>
---
 drivers/md/raid5.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 19d77a0..59c0569 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1921,8 +1921,10 @@ static void raid5_end_write_request(struct bio *bi, int error)
 					&rdev->mddev->recovery);
 		} else if (is_badblock(rdev, sh->sector,
 				       STRIPE_SECTORS,
-				       &first_bad, &bad_sectors))
+				       &first_bad, &bad_sectors)) {
 			set_bit(R5_MadeGood, &sh->dev[i].flags);
+			set_bit(R5_ReWrite, &sh->dev[i].flags);
+		}
 	}
 	rdev_dec_pending(rdev, conf->mddev);
 
  

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help