From: NeilBrown Date: Fri, 9 Dec 2011 03:27:05 +0000 (+1100) Subject: md/raid5: Mark device replaceable when we see a write error. X-Git-Tag: next-20111212~39^2~17 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=78214d3492ea37813c1d2d0871989f512ecaf92e;p=karo-tx-linux.git md/raid5: Mark device replaceable when we see a write error. Now that Replaceable drives are replaced cleanly, mark a drive as replaceable when we see a write error. It might get failed soon so the Replaceable flag is irrelevant, but if the write error is recorded in the bad block log, we still want to activate any spare that might be available. Signed-off-by: NeilBrown --- diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index cecacc6577e2..29d09371d114 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -1784,6 +1784,9 @@ static void raid5_end_write_request(struct bio *bi, int error) if (!uptodate) { set_bit(WriteErrorSeen, &rdev->flags); set_bit(R5_WriteError, &sh->dev[i].flags); + if (!test_and_set_bit(Replaceable, &rdev->flags)) + set_bit(MD_RECOVERY_NEEDED, + &rdev->mddev->recovery); } else if (is_badblock(rdev, sh->sector, STRIPE_SECTORS, &first_bad, &bad_sectors))