mtd: tests: abort torturetest on erase errors

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Dec 15 19:59:11 PST 2014


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=68f29815034e9dc9ed53cad85946c32b07adc8cc
Commit:     68f29815034e9dc9ed53cad85946c32b07adc8cc
Parent:     92b633a8a482c4bc1ff3b7cffdcace7836861554
Author:     Brian Norris <computersforpeace at gmail.com>
AuthorDate: Fri Nov 21 10:24:29 2014 -0800
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Fri Dec 12 19:28:43 2014 -0800

    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
       ...
    
    Fixes: 6cf78358c94f ("mtd: mtd_torturetest: use mtd_test helpers")
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
    Cc: Akinobu Mita <akinobu.mita at gmail.com>
    Cc: <stable at vger.kernel.org>
---
 drivers/mtd/tests/torturetest.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/tests/torturetest.c b/drivers/mtd/tests/torturetest.c
index eeab969..b55bc52 100644
--- a/drivers/mtd/tests/torturetest.c
+++ b/drivers/mtd/tests/torturetest.c
@@ -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) {



More information about the linux-mtd-cvs mailing list