aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authormajianpeng <majianpeng@gmail.com>2012-11-06 04:13:44 -0500
committerNeilBrown <neilb@suse.de>2012-11-19 18:27:05 -0500
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,
7936 sector_t *first_bad, int *bad_sectors) 7936 sector_t *first_bad, int *bad_sectors)
7937{ 7937{
7938 int hi; 7938 int hi;
7939 int lo = 0; 7939 int lo;
7940 u64 *p = bb->page; 7940 u64 *p = bb->page;
7941 int rv = 0; 7941 int rv;
7942 sector_t target = s + sectors; 7942 sector_t target = s + sectors;
7943 unsigned seq; 7943 unsigned seq;
7944 7944
@@ -7953,7 +7953,8 @@ int md_is_badblock(struct badblocks *bb, sector_t s, int sectors,
7953 7953
7954retry: 7954retry:
7955 seq = read_seqbegin(&bb->lock); 7955 seq = read_seqbegin(&bb->lock);
7956 7956 lo = 0;
7957 rv = 0;
7957 hi = bb->count; 7958 hi = bb->count;
7958 7959
7959 /* Binary search between lo and hi for 'target' 7960 /* Binary search between lo and hi for 'target'