All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gao Xiang <xiang@kernel.org>
To: Eric Sandeen <sandeen@redhat.com>
Cc: util-linux@vger.kernel.org, xiang@kernel.org,
	Karel Zak <kzak@redhat.com>
Subject: Re: [PATCH] blkid: allow up to 64k erofs block sizes
Date: Fri, 24 Jan 2025 07:22:36 +0800	[thread overview]
Message-ID: <Z5LPPNtOD3DqplCt@debian> (raw)
In-Reply-To: <71d43b45-9d53-48a1-8751-7080e50937e9@redhat.com>

Hi Eric,

On Thu, Jan 23, 2025 at 01:17:10PM -0600, Eric Sandeen wrote:
> Today, mkfs.erofs defaults to page size for block size, but blkid
> does not recognize this. Increase the limit to 64k.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> 
> (There might be strange arches out there > 64k but I don't know if
> erofs really works with blocks that big, so for now let's just
> limit it to 64k?)
> 
> diff --git a/libblkid/src/superblocks/erofs.c b/libblkid/src/superblocks/erofs.c
> index 05822460b..89620db47 100644
> --- a/libblkid/src/superblocks/erofs.c
> +++ b/libblkid/src/superblocks/erofs.c
> @@ -73,8 +73,8 @@ static int probe_erofs(blkid_probe pr, const struct blkid_idmag *mag)
>  	if (!sb)
>  		return errno ? -errno : BLKID_PROBE_NONE;
>  
> -	/* EROFS is restricted to 4KiB block size */
> -	if (sb->blkszbits > 31 || (1U << sb->blkszbits) > 4096)
> +	/* block size must be between 512 and 64k */
> +	if (sb->blkszbits > 31 || (1U << sb->blkszbits) > 65536)

I think it should be

	if (sb->blkszbits < 9 || ..

?

Also (1U << sb->blkszbits) might be overflowed, so just use
sb->blkszbits > 16.

Otherwise it looks good to me.

Thanks,
Gao Xiang

>  		return BLKID_PROBE_NONE;
>  
>  	if (!erofs_verify_checksum(pr, mag, sb))
> 

  reply	other threads:[~2025-01-23 23:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-23 19:17 [PATCH] blkid: allow up to 64k erofs block sizes Eric Sandeen
2025-01-23 23:22 ` Gao Xiang [this message]
2025-01-24 14:37 ` [PATCH V2] " Eric Sandeen
2025-01-25 15:19   ` Gao Xiang
2025-01-30  9:49     ` Karel Zak

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=Z5LPPNtOD3DqplCt@debian \
    --to=xiang@kernel.org \
    --cc=kzak@redhat.com \
    --cc=sandeen@redhat.com \
    --cc=util-linux@vger.kernel.org \
    /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.