Skip to contentSkip to conversation

mkfs.ubifs: correct and improve LEB size error prints

PATCH In review Brian Norris 2 participants 2 messages Mar 22, 2014 – Mar 31, 2014 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mkfs.ubifs: correct and improve LEB size error prints

The error message is incorrect for "too small LEB size" -- we were printing the minimum I/O size instead of the LEB size.

At the same time, let's print the max LEB size along with the message for "too large LEB size", to be consistent and more helpful.

---
 mkfs.ubifs/mkfs.ubifs.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
mkfs.ubifs/mkfs.ubifs.c +3 -2
index f9977bcad73f..200c8a5007e4 100644
@@ -352,13 +352,14 @@ static int validate_options(void)
 		return err_msg("min. I/O unit cannot be larger than LEB size");
 	if (c->leb_size < UBIFS_MIN_LEB_SZ)
 		return err_msg("too small LEB size %d, minimum is %d",
-			       c->min_io_size, UBIFS_MIN_LEB_SZ);
+			       c->leb_size, UBIFS_MIN_LEB_SZ);
 	if (c->leb_size % c->min_io_size)
 		return err_msg("LEB should be multiple of min. I/O units");
 	if (c->leb_size % 8)
 		return err_msg("LEB size has to be multiple of 8");
 	if (c->leb_size > UBIFS_MAX_LEB_SZ)
-		return err_msg("too large LEB size %d", c->leb_size);
+		return err_msg("too large LEB size %d, maximum is %d",
+				c->leb_size, UBIFS_MAX_LEB_SZ);
 	if (c->max_leb_cnt < UBIFS_MIN_LEB_CNT)
 		return err_msg("too low max. count of LEBs, minimum is %d",
 			       UBIFS_MIN_LEB_CNT);
Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 8 lines · Brian Norris

The error message is incorrect for "too small LEB size" -- we were printing the minimum I/O size instead of the LEB size.

At the same time, let's print the max LEB size along with the message for "too large LEB size", to be consistent and more helpful.

			       UBIFS_MIN_LEB_CNT);

Pushed, thanks!

Signature · 2 lines
Best Regards,
Artem Bityutskiy