From f3ab1c8d26fbb29c6ed7424cfad19f570e739987 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Mon, 24 Aug 2009 15:24:41 +0300 Subject: 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 --- ubi-utils/src/ubiformat.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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; -- cgit v1.2.3