Linux-EROFS Archive mirror
 help / color / mirror / Atom feed
From: Gao Xiang via Linux-erofs <linux-erofs@lists.ozlabs.org>
To: Sandeep Dhavale <dhavale@google.com>
Cc: hsiangkao@linux.alibaba.com, kernel-team@android.com,
	linux-erofs@lists.ozlabs.org
Subject: Re: [PATCH v2] erofs-utils: dump: print filesystem blocksize
Date: Tue, 16 Apr 2024 08:52:58 +0800	[thread overview]
Message-ID: <Zh3L6o+LSrvMiVkx@debian> (raw)
In-Reply-To: <20240415183538.2012717-1-dhavale@google.com>

Hi Sandeep,

On Mon, Apr 15, 2024 at 11:35:38AM -0700, Sandeep Dhavale wrote:
> mkfs.erofs supports creating filesystem images with different
> blocksizes. Add filesystem blocksize in super block dump so
> its easier to inspect the filesystem.
>
> The field is added after FS magic, so the output now looks like:
>
> Filesystem magic number:                      0xE0F5E1E2
> Filesystem blocksize:                         65536
> Filesystem blocks:                            21
> Filesystem inode metadata start block:        0
> Filesystem shared xattr metadata start block: 0
> Filesystem root nid:                          36
> Filesystem lz4_max_distance:                  65535
> Filesystem sb_extslots:                       0
> Filesystem inode count:                       10
> Filesystem created:                           Fri Apr 12 15:43:40 2024
> Filesystem features:                          sb_csum mtime 0padding
> Filesystem UUID:                              a84a2acc-08d8-4b72-8b8c-b811a815fa07
>
> Signed-off-by: Sandeep Dhavale <dhavale@google.com>
> ---
> Changes since v2:
> 	- Moved the field after FS magic as suggested by Gao
>  dump/main.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/dump/main.c b/dump/main.c
> index a89fc6b..928909d 100644
> --- a/dump/main.c
> +++ b/dump/main.c
> @@ -633,6 +633,8 @@ static void erofsdump_show_superblock(void)
>
>  	fprintf(stdout, "Filesystem magic number:                      0x%04X\n",
>  			EROFS_SUPER_MAGIC_V1);
> +	fprintf(stdout, "Filesystem blocksize:                         %llu\n",
> +			erofs_blksiz(&sbi) | 0ULL);

Could we use `%u` for `erofs_blksiz(&sbi)`? since currently EROFS
block size isn't possible to be larger than PAGE_SIZE.

Even if block size > page size is supported, I think we should
not consider too large blocksizes.

Otherwise it looks good to me.

Thanks,
Gao Xiang

      reply	other threads:[~2024-04-16  0:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15 18:35 [PATCH v2] erofs-utils: dump: print filesystem blocksize Sandeep Dhavale via Linux-erofs
2024-04-16  0:52 ` Gao Xiang via Linux-erofs [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=Zh3L6o+LSrvMiVkx@debian \
    --to=linux-erofs@lists.ozlabs.org \
    --cc=dhavale@google.com \
    --cc=hsiangkao@gmx.com \
    --cc=hsiangkao@linux.alibaba.com \
    --cc=kernel-team@android.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).