[PATCH] mtdtest: Check bbt at index of (eb + 1) when we access 2 EBs.
Dongsheng Yang
yangds.fnst at cn.fujitsu.com
Sun Aug 17 19:27:59 PDT 2014
When we want to access 2 eraseblocks, we need to make sure the
two eraseblocks both are not bad.
Signed-off-by: Dongsheng Yang <yangds.fnst at cn.fujitsu.com>
---
drivers/mtd/tests/stresstest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/tests/stresstest.c b/drivers/mtd/tests/stresstest.c
index c9d42cc..076d409 100644
--- a/drivers/mtd/tests/stresstest.c
+++ b/drivers/mtd/tests/stresstest.c
@@ -60,7 +60,7 @@ again:
eb = prandom_u32();
/* Read or write up 2 eraseblocks at a time - hence 'ebcnt - 1' */
eb %= (ebcnt - 1);
- if (bbt[eb])
+ if (bbt[eb] || bbt[eb + 1])
goto again;
return eb;
}
--
1.8.4.2
More information about the linux-mtd
mailing list