aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid10.c
diff options
context:
space:
mode:
authorJianpeng Ma <majianpeng@gmail.com>2012-10-10 23:17:59 -0400
committerNeilBrown <neilb@suse.de>2012-10-10 23:17:59 -0400
commit7f7583d420231b9d09897afd57a957011b606a5b (patch)
treeaa45d88b926bfc8e22f841b9ea83d338afa4c3ae /drivers/md/raid10.c
parent1ed850f356a0a422013846b5291acff08815008b (diff)
Subject: [PATCH] md:change resync_mismatches to atomic64_t to avoid races
Now that multiple threads can handle stripes, it is safer to use an atomic64_t for resync_mismatches, to avoid update races. Signed-off-by: Jianpeng Ma <majianpeng@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r--drivers/md/raid10.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index fb5bd607e15c..146749b277c6 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;