summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authormajianpeng <majianpeng@gmail.com>2012-11-06 17:13:44 +0800
committerNeilBrown <neilb@suse.de>2012-11-20 10:27:05 +1100
commitab05613a0646dcc11049692d54bae76ca9ffa910 (patch)
tree1d1cfb2cef6d0092c0ef88558b694f58298c31f5 /drivers/md
parented30be077e705e0dff53bfc51d23feb8aeeab78f (diff)
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 <majianpeng@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-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 9ab768acfb62..14db6abb2c42 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'