public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Wang Yugui <wangyugui@e16-tech.com>
To: linux-btrfs@vger.kernel.org
Cc: dsterba@suse.com, johannes.thumshirn@wdc.com,
	naohiro.aota@wdc.com, damien.lemoal@wdc.com, pankydev8@gmail.com,
	p.raghav@samsung.com, mcgrof@kernel.org
Subject: Re: [PATCH 2/2] btrfs-progs: mkfs: use pretty_size_mode() on min size error
Date: Sat, 10 Sep 2022 07:10:58 +0800	[thread overview]
Message-ID: <20220910071057.1F80.409509F4@e16-tech.com> (raw)
In-Reply-To: <20220909214810.761928-3-mcgrof@kernel.org>

Hi,

> 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

Could we do a rename 'block_count' to 'byte_count' here?

It is a size based on byte, not based on block (sector).

and '--byte-count' is used as a param of mkfs.btrfs.

Best Regards
Wang Yugui (wangyugui@e16-tech.com)
2022/09/10



      reply	other threads:[~2022-09-09 23:12 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 ` [PATCH 2/2] btrfs-progs: mkfs: use pretty_size_mode() on min size error Luis Chamberlain
2022-09-09 23:10   ` Wang Yugui [this message]

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=20220910071057.1F80.409509F4@e16-tech.com \
    --to=wangyugui@e16-tech.com \
    --cc=damien.lemoal@wdc.com \
    --cc=dsterba@suse.com \
    --cc=johannes.thumshirn@wdc.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=mcgrof@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox