summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorNix <nix@esperi.org.uk>2017-05-16 05:13:31 -0400
committerShaohua Li <shli@fb.com>2017-05-24 19:31:13 -0400
commite153903686deac9ea8c499b49516126f1a844fdb (patch)
tree4509ecd27c4445b542e9c592ca835af1f99e845e /drivers/md
parent4179bc30b2fe85f827d93e0ae7ae8f49ad3afc02 (diff)
md: report sector of stripes with check mismatches
This makes it possible, with appropriate filesystem support, for a sysadmin to tell what is affected by the mismatch, and whether it should be ignored (if it's inside a swap partition, for instance). We ratelimit to prevent log flooding: if there are so many mismatches that ratelimiting is necessary, the individual messages are relatively unlikely to be important (either the machine is swapping like crazy or something is very wrong with the disk). Signed-off-by: Nick Alcock <nick.alcock@oracle.com> Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/raid5.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 9c4f7659f8b1..722064689e82 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -4085,10 +4085,15 @@ static void handle_parity_checks5(struct r5conf *conf, struct stripe_head *sh,
4085 set_bit(STRIPE_INSYNC, &sh->state); 4085 set_bit(STRIPE_INSYNC, &sh->state);
4086 else { 4086 else {
4087 atomic64_add(STRIPE_SECTORS, &conf->mddev->resync_mismatches); 4087 atomic64_add(STRIPE_SECTORS, &conf->mddev->resync_mismatches);
4088 if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery)) 4088 if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery)) {
4089 /* don't try to repair!! */ 4089 /* don't try to repair!! */
4090 set_bit(STRIPE_INSYNC, &sh->state); 4090 set_bit(STRIPE_INSYNC, &sh->state);
4091 else { 4091 pr_warn_ratelimited("%s: mismatch sector in range "
4092 "%llu-%llu\n", mdname(conf->mddev),
4093 (unsigned long long) sh->sector,
4094 (unsigned long long) sh->sector +
4095 STRIPE_SECTORS);
4096 } else {
4092 sh->check_state = check_state_compute_run; 4097 sh->check_state = check_state_compute_run;
4093 set_bit(STRIPE_COMPUTE_RUN, &sh->state); 4098 set_bit(STRIPE_COMPUTE_RUN, &sh->state);
4094 set_bit(STRIPE_OP_COMPUTE_BLK, &s->ops_request); 4099 set_bit(STRIPE_OP_COMPUTE_BLK, &s->ops_request);
@@ -4237,10 +4242,15 @@ static void handle_parity_checks6(struct r5conf *conf, struct stripe_head *sh,
4237 } 4242 }
4238 } else { 4243 } else {
4239 atomic64_add(STRIPE_SECTORS, &conf->mddev->resync_mismatches); 4244 atomic64_add(STRIPE_SECTORS, &conf->mddev->resync_mismatches);
4240 if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery)) 4245 if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery)) {
4241 /* don't try to repair!! */ 4246 /* don't try to repair!! */
4242 set_bit(STRIPE_INSYNC, &sh->state); 4247 set_bit(STRIPE_INSYNC, &sh->state);
4243 else { 4248 pr_warn_ratelimited("%s: mismatch sector in range "
4249 "%llu-%llu\n", mdname(conf->mddev),
4250 (unsigned long long) sh->sector,
4251 (unsigned long long) sh->sector +
4252 STRIPE_SECTORS);
4253 } else {
4244 int *target = &sh->ops.target; 4254 int *target = &sh->ops.target;
4245 4255
4246 sh->ops.target = -1; 4256 sh->ops.target = -1;