]> git.karo-electronics.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)
committerNeilBrown <neilb@suse.de>
Tue, 6 Nov 2012 10:17:26 +0000 (21:17 +1100)
This bug was introduced by commit(v3.0-rc7-126-g2230dfe).
So fix is suitable for 3.0.y thru 3.6.y.

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

index 6fd7dc8606c241befa437a697bd5f88dc5f0fcc2..b6403a797bd52ff63cee42fd9ba7c44549763b9f 100644 (file)
@@ -7944,9 +7944,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;
 
@@ -7961,7 +7961,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'