Skip to contentSkip to conversation

md: Reassigned the parameters if read_seqretry returned true in func md_is_badblock.

PATCH Applied majianpeng 2 participants 2 messages Nov 6, 2012 MD RAID

lore
Share & tools
lore

majianpeng

author
#0 lore raw

PATCH 2/2 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.

---
 drivers/md/md.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/md/md.c +4 -3
index d63aa78..541c74c 100644
@@ -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'
Signature · 1 line
1.7.9.5
Applied
#1 lore raw
Quoted 26 lines · On Tue, 6 Nov 2012 17:13:44 +0800 majianpeng <[email protected]> wrote:

This bug was introduced by commit(v3.0-rc7-126-g2230dfe). So fix is suitable for 3.0.y thru 3.6.y.

---
 drivers/md/md.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/md/md.c +2 -2
index d63aa78..541c74c 100644
@@ -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;
 

drivers/md/md.c int md_is_badblock(struct badblocks *bb, sector_t s, int sectors, · line 7960

Quoted 9 lines
drivers/md/md.c +2 -1
@@ -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'

Applied, thanks.

NeilBrown