]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
md: Reassigned the parameters if read_seqretry returned true in func md_is_badblock.
authormajianpeng <majianpeng@gmail.com>
Tue, 6 Nov 2012 09:13:44 +0000 (17:13 +0800)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 6 Dec 2012 11:20:28 +0000 (11:20 +0000)
commit ab05613a0646dcc11049692d54bae76ca9ffa910 upstream.

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

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/md/md.c

index 2887f2287aca16463aa5aea0cd6af6d3fb9566b7..b4ce8919ae9b99473adde652537e92302bf3df7c 100644 (file)
@@ -7650,9 +7650,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;
 
@@ -7667,7 +7667,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'