mtd: tests: abort torturetest on erase errors
PATCH 1/1 mtd: tests: abort torturetest on erase errors
The torture test should quit once it actually induces an error in the flash. This step was accidentally removed during refactoring.
Without this fix, the torturetest just continues infinitely, or until the maximum cycle count is reached. e.g.:
...
[ 7619.218171] mtd_test: error -5 while erasing EB 100 [ 7619.297981] mtd_test: error -5 while erasing EB 100 [ 7619.377953] mtd_test: error -5 while erasing EB 100 [ 7619.457998] mtd_test: error -5 while erasing EB 100 [ 7619.537990] mtd_test: error -5 while erasing EB 100 ...
--- drivers/mtd/tests/torturetest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mtd/tests/torturetest.c +3 -1
@@ -264,7 +264,9 @@ static int __init tort_init(void)int i;void *patt; -mtdtest_erase_good_eraseblocks (mtd, bad_ebs, eb, ebcnt); + err =mtdtest_erase_good_eraseblocks (mtd, bad_ebs, eb, ebcnt); +if (err) + goto out;/* Check if the eraseblocks contain only 0xFF bytes */ if (check) {
Signature · 1 line
1.9.1
A message that is not in the archive (sent off-list or not yet received): [email protected]
+ linux-mtd
Quoted 2 lines · Jeff Lauruhn (jlauruhn)
Brian;
What is the purpose of the torture test?
Please, no personal questions like this. Ask publicly so others can learn.
And please read the code, comments, and existing documentation first. e.g.:
http://www.linux-mtd.infradead.org/doc/general.html#L_mtd_tests
Brian
Brian Norris
AppliedQuoted 14 lines · Brian Norris
The torture test should quit once it actually induces an error in the flash. This step was accidentally removed during refactoring.
Without this fix, the torturetest just continues infinitely, or until the maximum cycle count is reached. e.g.:
... [ 7619.218171] mtd_test: error -5 while erasing EB 100 [ 7619.297981] mtd_test: error -5 while erasing EB 100 [ 7619.377953] mtd_test: error -5 while erasing EB 100 [ 7619.457998] mtd_test: error -5 while erasing EB 100 [ 7619.537990] mtd_test: error -5 while erasing EB 100 ...
Quoted 4 lines
Fixes 6cf78358c94f ("mtd: mtd_torturetest: use mtd_test helpers")Signed-off-by Brian Norris <[email protected]>Cc Akinobu Mita <[email protected]>Cc <[email protected]>
Applied to l2-mtd.git.
Brian