[PATCH v2] erofs-utils: adjust volume label maximum length to the kernel implementation

Gao Xiang hsiangkao at linux.alibaba.com
Thu Aug 15 13:28:37 AEST 2024


Hi Naoto,

On 2024/8/14 23:53, Naoto Yamaguchi wrote:
> The erofs implementation of kernel has limitation of the volume label length.
> The volume label data size of super block is 16 bytes.
> The kernel implementation requires to null terminate inside a that 16 bytes.
> 
> Logs:
>    $ ./mkfs/mkfs.erofs test16.erofs -L 0123456789abcdef test/
>    $ mount -o loop ./test16.erofs ./mnt/
>    $ dmesg
>    [26477.019283] erofs: (device loop0): erofs_read_superblock: bad volume name without NIL terminator
> 
>    $ ./mkfs/mkfs.erofs test15.erofs -L 0123456789abcde test/
>    $ mount -o loop ./test15.erofs ./mnt/
>    $ dmesg
>    [26500.516871] erofs: (device loop0): mounted with root inode @ nid 36.
> 
> This patch adjusts volume label maximum length to the kernel implementation.
> 
> Signed-off-by: Naoto Yamaguchi <naoto.yamaguchi at aisin.co.jp>

Thanks for catching this, it's indeed an issue.

Although that is not intended, but considering it has
been the case for quite long time.

> ---
>   mkfs/main.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mkfs/main.c b/mkfs/main.c
> index b7129eb..ff26c16 100644
> --- a/mkfs/main.c
> +++ b/mkfs/main.c
> @@ -151,7 +151,7 @@ static void usage(int argc, char **argv)
>   	printf(
>   		" -C#                   specify the size of compress physical cluster in bytes\n"
>   		" -EX[,...]             X=extended options\n"
> -		" -L volume-label       set the volume label (maximum 16)\n"
> +		" -L volume-label       set the volume label (maximum 15 character)\n"

15 character might be ambiguous here, since there could be other encodings I guess?

Thanks,
Gao Xiang


More information about the Linux-erofs mailing list