]> www.infradead.org Git - mtd-utils.git/commitdiff
mkfs.ubifs: do not forget to torture PEB
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Mon, 24 Aug 2009 12:24:41 +0000 (15:24 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Mon, 24 Aug 2009 12:24:41 +0000 (15:24 +0300)
We added PEB torturing for the case when we fail during flashing
an image, but forgot to add it for the case when we are formating
the flash. Add the forgottent torturing call.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
ubi-utils/src/ubiformat.c

index 3f1f5128ade3f2a6b106f86036165a98678884c7..fe7040e8b3e0eb665ec2d4ec50e04dda8a1f8d56 100644 (file)
@@ -527,10 +527,8 @@ static int flash_image(const struct mtd_dev_info *mtd, struct ubi_scan_info *si)
 
                        err = mtd_torture(mtd, args.node_fd, eb);
                        if (err) {
-                               if (mark_bad(mtd, si, eb)) {
-                                       normsg("operation incomplete");
+                               if (mark_bad(mtd, si, eb))
                                        goto out_close;
-                               }
                        }
                        continue;
                }
@@ -636,9 +634,10 @@ static int format(const struct mtd_dev_info *mtd, const struct ubigen_info *ui,
                                goto out_free;
                        }
 
-                       if (mark_bad(mtd, si, eb)) {
-                               normsg("operation incomplete");
-                               goto out_free;
+                       err = mtd_torture(mtd, args.node_fd, eb);
+                       if (err) {
+                               if (mark_bad(mtd, si, eb))
+                                       goto out_free;
                        }
                        continue;