md:Add place to update ->recovery_cp.
authorkernelmail <kedacomkernel@gmail.com>
Wed, 31 Oct 2012 00:59:10 +0000 (11:59 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 13 Dec 2012 05:41:01 +0000 (16:41 +1100)
In resyncing, recovery_cp only updated when resync aborted or completed.
But in md drives,many place used it to judge.So add a place to update.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/md.c

index 520056a8873923895714da51c9a015ecead4d341..f970834764756a51fbaade6c4853e0f74cbf9feb 100644 (file)
@@ -7462,6 +7462,9 @@ void md_do_sync(struct md_thread *thread)
                        wait_event(mddev->recovery_wait,
                                   atomic_read(&mddev->recovery_active) == 0);
                        mddev->curr_resync_completed = j;
+                       if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) &&
+                           j > mddev->recovery_cp)
+                               mddev->recovery_cp = j;
                        set_bit(MD_CHANGE_CLEAN, &mddev->flags);
                        sysfs_notify(&mddev->kobj, NULL, "sync_completed");
                }