diff options
author | NeilBrown <neilb@suse.de> | 2005-11-09 00:39:26 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-09 10:56:37 -0500 |
commit | 9d88883e68f404d5581bd391713ceef470ea53a9 (patch) | |
tree | 09217a737ca91fb1d105df601741a61e141d4946 /drivers/md/raid5.c | |
parent | 24dd469d728dae07f40c5d79ea6dedd38cdf1a30 (diff) |
[PATCH] md: teach raid5 the difference between 'check' and 'repair'.
With this, raid5 can be asked to check parity without repairing it. It also
keeps a count of the number of incorrect parity blocks found (mismatches) and
reports them through sysfs.
Signed-off-by: Neil Brown <neilb@suse.de>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r-- | drivers/md/raid5.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 121fbaa9ed59..ce154553aca5 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -1292,6 +1292,11 @@ static void handle_stripe(struct stripe_head *sh) | |||
1292 | !memcmp(pagea, pagea+4, STRIPE_SIZE-4)) { | 1292 | !memcmp(pagea, pagea+4, STRIPE_SIZE-4)) { |
1293 | /* parity is correct (on disc, not in buffer any more) */ | 1293 | /* parity is correct (on disc, not in buffer any more) */ |
1294 | set_bit(STRIPE_INSYNC, &sh->state); | 1294 | set_bit(STRIPE_INSYNC, &sh->state); |
1295 | } else { | ||
1296 | conf->mddev->resync_mismatches += STRIPE_SECTORS; | ||
1297 | if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery)) | ||
1298 | /* don't try to repair!! */ | ||
1299 | set_bit(STRIPE_INSYNC, &sh->state); | ||
1295 | } | 1300 | } |
1296 | } | 1301 | } |
1297 | if (!test_bit(STRIPE_INSYNC, &sh->state)) { | 1302 | if (!test_bit(STRIPE_INSYNC, &sh->state)) { |