This is a note to let you know that I've just added the patch titled

    md/raid5: Fix a bug about judging if the operation is syncing or replacing

to the 3.3-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     
md-raid5-fix-a-bug-about-judging-if-the-operation-is-syncing-or-replacing.patch
and it can be found in the queue-3.3 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From c6d2e084c7411f61f2b446d94989e5aaf9879b0f Mon Sep 17 00:00:00 2001
From: majianpeng <[email protected]>
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 <[email protected]>

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 <[email protected]>
Signed-off-by: NeilBrown <[email protected]>
Cc: Jes Sorensen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 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;


Patches currently in stable-queue which might be from [email protected] are

queue-3.3/md-raid5-fix-a-bug-about-judging-if-the-operation-is-syncing-or-replacing.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to