Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 334255
b: refs/heads/master
c: 7f7583d
h: refs/heads/master
i:
  334253: f2343b6
  334251: f471f3f
  334247: 117333c
  334239: 6c10e80
v: v3
  • Loading branch information
Jianpeng Ma authored and NeilBrown committed Oct 11, 2012
1 parent afb2cff commit fc4cb0a
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1ed850f356a0a422013846b5291acff08815008b
refs/heads/master: 7f7583d420231b9d09897afd57a957011b606a5b
7 changes: 4 additions & 3 deletions trunk/drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -4269,7 +4269,8 @@ static ssize_t
mismatch_cnt_show(struct mddev *mddev, char *page)
{
return sprintf(page, "%llu\n",
(unsigned long long) mddev->resync_mismatches);
(unsigned long long)
atomic64_read(&mddev->resync_mismatches));
}

static struct md_sysfs_entry md_scan_mode =
Expand Down Expand Up @@ -5235,7 +5236,7 @@ static void md_clean(struct mddev *mddev)
mddev->new_layout = 0;
mddev->new_chunk_sectors = 0;
mddev->curr_resync = 0;
mddev->resync_mismatches = 0;
atomic64_set(&mddev->resync_mismatches, 0);
mddev->suspend_lo = mddev->suspend_hi = 0;
mddev->sync_speed_min = mddev->sync_speed_max = 0;
mddev->recovery = 0;
Expand Down Expand Up @@ -7357,7 +7358,7 @@ void md_do_sync(struct md_thread *thread)
* which defaults to physical size, but can be virtual size
*/
max_sectors = mddev->resync_max_sectors;
mddev->resync_mismatches = 0;
atomic64_set(&mddev->resync_mismatches, 0);
/* we don't use the checkpoint if there's a bitmap */
if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery))
j = mddev->resync_min;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/md/md.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ struct mddev {

sector_t resync_max_sectors; /* may be set by personality */

sector_t resync_mismatches; /* count of sectors where
atomic64_t resync_mismatches; /* count of sectors where
* parity/replica mismatch found
*/

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/md/raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1876,7 +1876,7 @@ static int process_checks(struct r1bio *r1_bio)
} else
j = 0;
if (j >= 0)
mddev->resync_mismatches += r1_bio->sectors;
atomic64_add(r1_bio->sectors, &mddev->resync_mismatches);
if (j < 0 || (test_bit(MD_RECOVERY_CHECK, &mddev->recovery)
&& test_bit(BIO_UPTODATE, &sbio->bi_flags))) {
/* No need to write to this device. */
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/md/raid10.c
Original file line number Diff line number Diff line change
Expand Up @@ -2011,7 +2011,7 @@ static void sync_request_write(struct mddev *mddev, struct r10bio *r10_bio)
break;
if (j == vcnt)
continue;
mddev->resync_mismatches += r10_bio->sectors;
atomic64_add(r10_bio->sectors, &mddev->resync_mismatches);
if (test_bit(MD_RECOVERY_CHECK, &mddev->recovery))
/* Don't fix anything. */
continue;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -2973,7 +2973,7 @@ static void handle_parity_checks5(struct r5conf *conf, struct stripe_head *sh,
*/
set_bit(STRIPE_INSYNC, &sh->state);
else {
conf->mddev->resync_mismatches += STRIPE_SECTORS;
atomic64_add(STRIPE_SECTORS, &conf->mddev->resync_mismatches);
if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery))
/* don't try to repair!! */
set_bit(STRIPE_INSYNC, &sh->state);
Expand Down Expand Up @@ -3125,7 +3125,7 @@ static void handle_parity_checks6(struct r5conf *conf, struct stripe_head *sh,
*/
}
} else {
conf->mddev->resync_mismatches += STRIPE_SECTORS;
atomic64_add(STRIPE_SECTORS, &conf->mddev->resync_mismatches);
if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery))
/* don't try to repair!! */
set_bit(STRIPE_INSYNC, &sh->state);
Expand Down

0 comments on commit fc4cb0a

Please sign in to comment.