From: Greg Kroah-Hartman Date: Fri, 4 May 2012 15:11:49 +0000 (-0700) Subject: 3.3-stable patches X-Git-Tag: v3.3.5~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a8c6f86fb98d8231d8be3d52687dae8dabf6d7a2;p=thirdparty%2Fkernel%2Fstable-queue.git 3.3-stable patches added patches: md-raid5-fix-a-bug-about-judging-if-the-operation-is-syncing-or-replacing.patch --- diff --git a/queue-3.3/md-raid5-fix-a-bug-about-judging-if-the-operation-is-syncing-or-replacing.patch b/queue-3.3/md-raid5-fix-a-bug-about-judging-if-the-operation-is-syncing-or-replacing.patch new file mode 100644 index 00000000000..0832ec227db --- /dev/null +++ b/queue-3.3/md-raid5-fix-a-bug-about-judging-if-the-operation-is-syncing-or-replacing.patch @@ -0,0 +1,52 @@ +From c6d2e084c7411f61f2b446d94989e5aaf9879b0f Mon Sep 17 00:00:00 2001 +From: majianpeng +Date: Mon, 2 Apr 2012 01:16:59 +1000 +Subject: md/raid5: Fix a bug about judging if the operation is syncing or replacing + +From: majianpeng + +commit c6d2e084c7411f61f2b446d94989e5aaf9879b0f upstream. + +When create a raid5 using assume-clean and echo check or repair to +sync_action.Then component disks did not operated IO but the raid +check/resync faster than normal. +Because the judgement in function analyse_stripe(): + if (do_recovery || + sh->sector >= conf->mddev->recovery_cp) + s->syncing = 1; + else + s->replacing = 1; +When check or repair,the recovery_cp == MaxSectore,so syncing equal zero +not one. + +This bug was introduced by commit 9a3e1101b827 + md/raid5: detect and handle replacements during recovery. +so this patch is suitable for 3.3-stable. + +Signed-off-by: majianpeng +Signed-off-by: NeilBrown +Cc: Jes Sorensen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/md/raid5.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/md/raid5.c ++++ b/drivers/md/raid5.c +@@ -3277,12 +3277,14 @@ static void analyse_stripe(struct stripe + /* If there is a failed device being replaced, + * we must be recovering. + * else if we are after recovery_cp, we must be syncing ++ * else if MD_RECOVERY_REQUESTED is set, we also are syncing. + * else we can only be replacing + * sync and recovery both need to read all devices, and so + * use the same flag. + */ + if (do_recovery || +- sh->sector >= conf->mddev->recovery_cp) ++ sh->sector >= conf->mddev->recovery_cp || ++ test_bit(MD_RECOVERY_REQUESTED, &(conf->mddev->recovery))) + s->syncing = 1; + else + s->replacing = 1; diff --git a/queue-3.3/series b/queue-3.3/series index 7e261a644f0..ce12b17a199 100644 --- a/queue-3.3/series +++ b/queue-3.3/series @@ -56,3 +56,4 @@ pm-hibernate-fix-the-number-of-pages-used-for-hibernate-thaw-buffering.patch sched-fix-nohz-load-accounting-again.patch exit_signal-simplify-the-we-have-changed-execution-domain-logic.patch exit_signal-fix-the-parent-has-changed-security-domain-logic.patch +md-raid5-fix-a-bug-about-judging-if-the-operation-is-syncing-or-replacing.patch