Subject: [PATCH] md:change resync_mismatches to atomic64_t to avoid races
[deliverable/linux.git] / drivers / md / raid5.c
index ab613efbbeadfc3b458f19c7681c20a6b4051a32..4cc6b0e398bc9f2586ab909252effce4e3cf29ec 100644 (file)
@@ -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);
@@ -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);
This page took 0.026569 seconds and 5 git commands to generate.