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

Gao Xiang hsiangkao at linux.alibaba.com
Fri Aug 16 11:30:13 AEST 2024



On 2024/8/15 22:02, Naoto Yamaguchi wrote:
> Hi Gao.
> 
>>> ---
>>>    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?
> 
> I propose to...
> Solution 1.
>   -L volume-label       set the volume label (maximum 15 ASCII character)
> 
> Solution 2.
>   -L volume-label       set the volume label (maximum 15 bytes)
> 
> 
> Solution 3.  similar to tune2fs
> -L volume-label       set the volume label
> and
> erofs_err("Warning: label too long, truncating.");
> with truncating input string to 15 bytes.
> 
> Which is better?  Could you feedback?

I tend to use solution 2 anyway, solution 3 will truncate
the user input, not quite sure if that's the user's intention.

Thanks,
Gao Xiang

> 
> Thanks.
> Naoto Yamaguchi @ AGL community.


More information about the Linux-erofs mailing list