diff options
author | NeilBrown <neilb@suse.de> | 2011-12-23 10:17:54 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-12-23 10:17:54 +1100 |
commit | 3a6de2924af602f9c1b5a5154438c37f2d712dfa (patch) | |
tree | 895462dfefd70827c5b6d860503d1244d003a56e /drivers/md | |
parent | 7bfec5f35c68121e7b1849f3f4166dd96c8da5b3 (diff) | |
download | op-kernel-dev-3a6de2924af602f9c1b5a5154438c37f2d712dfa.zip op-kernel-dev-3a6de2924af602f9c1b5a5154438c37f2d712dfa.tar.gz |
md/raid5: Mark device want_replacement when we see a write error.
Now that WantReplacement drives are replaced cleanly, mark a drive
as WantReplacement when we see a write error. It might get failed soon so
the WantReplacement 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.
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid5.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index b2c8385..360f2b9 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -1796,6 +1796,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(WantReplacement, &rdev->flags)) + set_bit(MD_RECOVERY_NEEDED, + &rdev->mddev->recovery); } else if (is_badblock(rdev, sh->sector, STRIPE_SECTORS, &first_bad, &bad_sectors)) |