All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: dsterba@suse.com, johannes.thumshirn@wdc.com,
	naohiro.aota@wdc.com, linux-btrfs@vger.kernel.org,
	damien.lemoal@wdc.com
Cc: pankydev8@gmail.com, p.raghav@samsung.com, mcgrof@kernel.org
Subject: [PATCH 2/2] btrfs-progs: mkfs: use pretty_size_mode() on min size error
Date: Fri,  9 Sep 2022 14:48:10 -0700	[thread overview]
Message-ID: <20220909214810.761928-3-mcgrof@kernel.org> (raw)
In-Reply-To: <20220909214810.761928-1-mcgrof@kernel.org>

Use a human pretty output for the error message about the
minimum required size for a btrfs filesystem.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 mkfs/main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/mkfs/main.c b/mkfs/main.c
index ebf462587bd5..8a0018abd01e 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -1388,10 +1388,10 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
 	}
 	/* Check device/block_count after the nodesize is determined */
 	if (block_count && block_count < min_dev_size) {
-		error("size %llu is too small to make a usable filesystem",
-			block_count);
-		error("minimum size for btrfs filesystem is %llu",
-			min_dev_size);
+		error("Size %s is too small to make a usable filesystem",
+			pretty_size_mode(block_count, UNITS_DEFAULT));
+		error("minimum size for btrfs filesystem is %s",
+			pretty_size_mode(min_dev_size, UNITS_DEFAULT));
 		goto error;
 	}
 	/*
-- 
2.35.1


  parent reply	other threads:[~2022-09-09 21:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-09 21:48 [PATCH 0/2] btrfs-progs: minor mkfs fs size error message enhancements Luis Chamberlain
2022-09-09 21:48 ` [PATCH 1/2] btrfs-progs: mkfs: fix error message for minimum zoned filesystem size Luis Chamberlain
2022-09-14  8:28   ` Pankaj Raghav
2022-09-09 21:48 ` Luis Chamberlain [this message]
2022-09-09 23:10   ` [PATCH 2/2] btrfs-progs: mkfs: use pretty_size_mode() on min size error Wang Yugui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220909214810.761928-3-mcgrof@kernel.org \
    --to=mcgrof@kernel.org \
    --cc=damien.lemoal@wdc.com \
    --cc=dsterba@suse.com \
    --cc=johannes.thumshirn@wdc.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=naohiro.aota@wdc.com \
    --cc=p.raghav@samsung.com \
    --cc=pankydev8@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.