From: majianpeng Date: Tue, 6 Nov 2012 09:13:44 +0000 (+0800) Subject: md: Reassigned the parameters if read_seqretry returned true in func md_is_badblock. X-Git-Tag: next-20121107~52^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9c20f17f92ad2a27f1cad44bb9b0fa40268142f8;p=karo-tx-linux.git 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: stable@vger.kernel.org Signed-off-by: Jianpeng Ma Signed-off-by: NeilBrown --- diff --git a/drivers/md/md.c b/drivers/md/md.c index 6fd7dc8606c2..b6403a797bd5 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -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'