aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/md.c7
-rw-r--r--drivers/md/md.h2
-rw-r--r--drivers/md/raid1.c2
-rw-r--r--drivers/md/raid10.c2
-rw-r--r--drivers/md/raid5.c4
5 files changed, 9 insertions, 8 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 85e6786653e..7564c44b804 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4269,7 +4269,8 @@ static ssize_t
4269mismatch_cnt_show(struct mddev *mddev, char *page) 4269mismatch_cnt_show(struct mddev *mddev, char *page)
4270{ 4270{
4271 return sprintf(page, "%llu\n", 4271 return sprintf(page, "%llu\n",
4272 (unsigned long long) mddev->resync_mismatches); 4272 (unsigned long long)
4273 atomic64_read(&mddev->resync_mismatches));
4273} 4274}
4274 4275
4275static struct md_sysfs_entry md_scan_mode = 4276static struct md_sysfs_entry md_scan_mode =
@@ -5235,7 +5236,7 @@ static void md_clean(struct mddev *mddev)
5235 mddev->new_layout = 0; 5236 mddev->new_layout = 0;
5236 mddev->new_chunk_sectors = 0; 5237 mddev->new_chunk_sectors = 0;
5237 mddev->curr_resync = 0; 5238 mddev->curr_resync = 0;
5238 mddev->resync_mismatches = 0; 5239 atomic64_set(&mddev->resync_mismatches, 0);
5239 mddev->suspend_lo = mddev->suspend_hi = 0; 5240 mddev->suspend_lo = mddev->suspend_hi = 0;
5240 mddev->sync_speed_min = mddev->sync_speed_max = 0; 5241 mddev->sync_speed_min = mddev->sync_speed_max = 0;
5241 mddev->recovery = 0; 5242 mddev->recovery = 0;
@@ -7357,7 +7358,7 @@ void md_do_sync(struct md_thread *thread)
7357 * which defaults to physical size, but can be virtual size 7358 * which defaults to physical size, but can be virtual size
7358 */ 7359 */
7359 max_sectors = mddev->resync_max_sectors; 7360 max_sectors = mddev->resync_max_sectors;
7360 mddev->resync_mismatches = 0; 7361 atomic64_set(&mddev->resync_mismatches, 0);
7361 /* we don't use the checkpoint if there's a bitmap */ 7362 /* we don't use the checkpoint if there's a bitmap */
7362 if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) 7363 if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery))
7363 j = mddev->resync_min; 7364 j = mddev->resync_min;
diff --git a/drivers/md/md.h b/drivers/md/md.h
index 93ada214b50..af443ab868d 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -282,7 +282,7 @@ struct mddev {
282 282
283 sector_t resync_max_sectors; /* may be set by personality */ 283 sector_t resync_max_sectors; /* may be set by personality */
284 284
285 sector_t resync_mismatches; /* count of sectors where 285 atomic64_t resync_mismatches; /* count of sectors where
286 * parity/replica mismatch found 286 * parity/replica mismatch found
287 */ 287 */
288 288
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index e913356b257..8034fbd6190 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1876,7 +1876,7 @@ static int process_checks(struct r1bio *r1_bio)
1876 } else 1876 } else
1877 j = 0; 1877 j = 0;
1878 if (j >= 0) 1878 if (j >= 0)
1879 mddev->resync_mismatches += r1_bio->sectors; 1879 atomic64_add(r1_bio->sectors, &mddev->resync_mismatches);
1880 if (j < 0 || (test_bit(MD_RECOVERY_CHECK, &mddev->recovery) 1880 if (j < 0 || (test_bit(MD_RECOVERY_CHECK, &mddev->recovery)
1881 && test_bit(BIO_UPTODATE, &sbio->bi_flags))) { 1881 && test_bit(BIO_UPTODATE, &sbio->bi_flags))) {
1882 /* No need to write to this device. */ 1882 /* No need to write to this device. */
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index fb5bd607e15..146749b277c 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -2011,7 +2011,7 @@ static void sync_request_write(struct mddev *mddev, struct r10bio *r10_bio)
2011 break; 2011 break;
2012 if (j == vcnt) 2012 if (j == vcnt)
2013 continue; 2013 continue;
2014 mddev->resync_mismatches += r10_bio->sectors; 2014 atomic64_add(r10_bio->sectors, &mddev->resync_mismatches);
2015 if (test_bit(MD_RECOVERY_CHECK, &mddev->recovery)) 2015 if (test_bit(MD_RECOVERY_CHECK, &mddev->recovery))
2016 /* Don't fix anything. */ 2016 /* Don't fix anything. */
2017 continue; 2017 continue;
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index ab613efbbea..4cc6b0e398b 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -2973,7 +2973,7 @@ static void handle_parity_checks5(struct r5conf *conf, struct stripe_head *sh,
2973 */ 2973 */
2974 set_bit(STRIPE_INSYNC, &sh->state); 2974 set_bit(STRIPE_INSYNC, &sh->state);
2975 else { 2975 else {
2976 conf->mddev->resync_mismatches += STRIPE_SECTORS; 2976 atomic64_add(STRIPE_SECTORS, &conf->mddev->resync_mismatches);
2977 if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery)) 2977 if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery))
2978 /* don't try to repair!! */ 2978 /* don't try to repair!! */
2979 set_bit(STRIPE_INSYNC, &sh->state); 2979 set_bit(STRIPE_INSYNC, &sh->state);
@@ -3125,7 +3125,7 @@ static void handle_parity_checks6(struct r5conf *conf, struct stripe_head *sh,
3125 */ 3125 */
3126 } 3126 }
3127 } else { 3127 } else {
3128 conf->mddev->resync_mismatches += STRIPE_SECTORS; 3128 atomic64_add(STRIPE_SECTORS, &conf->mddev->resync_mismatches);
3129 if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery)) 3129 if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery))
3130 /* don't try to repair!! */ 3130 /* don't try to repair!! */
3131 set_bit(STRIPE_INSYNC, &sh->state); 3131 set_bit(STRIPE_INSYNC, &sh->state);