The patch below does not apply to the 3.0-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

>From ab05613a0646dcc11049692d54bae76ca9ffa910 Mon Sep 17 00:00:00 2001
From: majianpeng <[email protected]>
Date: Tue, 6 Nov 2012 17:13:44 +0800
Subject: [PATCH] md: Reassigned the parameters if read_seqretry returned true
 in func md_is_badblock.

This bug was introduced by commit(v3.0-rc7-126-g2230dfe).
So fix is suitable for 3.0.y thru 3.6.y.

Cc: [email protected]
Signed-off-by: Jianpeng Ma <[email protected]>
Signed-off-by: NeilBrown <[email protected]>

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 9ab768a..14db6ab 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -7936,9 +7936,9 @@ int md_is_badblock(struct badblocks *bb, sector_t s, int 
sectors,
                   sector_t *first_bad, int *bad_sectors)
 {
        int hi;
-       int lo = 0;
+       int lo;
        u64 *p = bb->page;
-       int rv = 0;
+       int rv;
        sector_t target = s + sectors;
        unsigned seq;
 
@@ -7953,7 +7953,8 @@ int md_is_badblock(struct badblocks *bb, sector_t s, int 
sectors,
 
 retry:
        seq = read_seqbegin(&bb->lock);
-
+       lo = 0;
+       rv = 0;
        hi = bb->count;
 
        /* Binary search between lo and hi for 'target'

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