aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authormajianpeng <majianpeng@gmail.com>2012-11-06 17:13:44 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-12-03 11:47:06 -0800
commit45bc5c6913e04f1346bfe3401d2f52ad2164b3b2 (patch)
tree27bfd93fe81f8b1d514b7d075d3c4aecde23c1ce /drivers
parent262a70e8fbf870359ced2059becf116a249bb2d5 (diff)
md: Reassigned the parameters if read_seqretry returned true in func md_is_badblock.
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/md.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 529ce89b30b..2b399da4bba 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -7694,9 +7694,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;
@@ -7711,7 +7711,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'