diff options
author | Jianpeng Ma <majianpeng@gmail.com> | 2012-10-10 23:17:59 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-10-10 23:17:59 -0400 |
commit | 7f7583d420231b9d09897afd57a957011b606a5b (patch) | |
tree | aa45d88b926bfc8e22f841b9ea83d338afa4c3ae /drivers/md/raid1.c | |
parent | 1ed850f356a0a422013846b5291acff08815008b (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/raid1.c')
-rw-r--r-- | drivers/md/raid1.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index e913356b257e..8034fbd6190c 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. */ |