Skip to content

Commit

Permalink
md: Reassigned the parameters if read_seqretry returned true in func …
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
majianpeng authored and NeilBrown committed Nov 19, 2012
1 parent ed30be0 commit ab05613
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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'
Expand Down

0 comments on commit ab05613

Please sign in to comment.