From: Artem Bityutskiy Date: Mon, 24 Aug 2009 12:24:41 +0000 (+0300) Subject: mkfs.ubifs: do not forget to torture PEB X-Git-Tag: v1.3.0~14 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f3ab1c8d26fbb29c6ed7424cfad19f570e739987;p=mtd-utils.git mkfs.ubifs: do not forget to torture PEB 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 --- diff --git a/ubi-utils/src/ubiformat.c b/ubi-utils/src/ubiformat.c index 3f1f512..fe7040e 100644 --- a/ubi-utils/src/ubiformat.c +++ b/ubi-utils/src/ubiformat.c @@ -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;