Re: [PATCH] blkid: allow up to 64k erofs block sizes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
> 
> (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))
> 




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux