linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mkfs.ubifs: correct and improve LEB size error prints
@ 2014-03-22  6:45 Brian Norris
  2014-03-31  9:50 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Brian Norris @ 2014-03-22  6:45 UTC (permalink / raw)
  To: linux-mtd; +Cc: 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.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 mkfs.ubifs/mkfs.ubifs.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mkfs.ubifs/mkfs.ubifs.c b/mkfs.ubifs/mkfs.ubifs.c
index f9977bcad73f..200c8a5007e4 100644
--- a/mkfs.ubifs/mkfs.ubifs.c
+++ b/mkfs.ubifs/mkfs.ubifs.c
@@ -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);
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mkfs.ubifs: correct and improve LEB size error prints
  2014-03-22  6:45 [PATCH] mkfs.ubifs: correct and improve LEB size error prints Brian Norris
@ 2014-03-31  9:50 ` Artem Bityutskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2014-03-31  9:50 UTC (permalink / raw)
  To: Brian Norris; +Cc: linux-mtd

On Fri, 2014-03-21 at 23:45 -0700, Brian Norris wrote:
> 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.
> 
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> 			       UBIFS_MIN_LEB_CNT);

Pushed, thanks!

-- 
Best Regards,
Artem Bityutskiy

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-31  9:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-22  6:45 [PATCH] mkfs.ubifs: correct and improve LEB size error prints Brian Norris
2014-03-31  9:50 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).