[LTP] [PATCH 3/3] Provide a PATH_MAX-long buffer when expecting ENAMETOOLONG

Kevin Brodsky kevin.brodsky@arm.com
Mon Oct 23 16:50:33 CEST 2023


On 23/10/2023 16:40, Cyril Hrubis wrote:
> Hi!
>> A number of tests check that syscalls manipulating paths return
>> -ENAMETOOLONG when the specified path is longer than allowed. There
>> are actually two ways this error can be triggered:
>>
>> 1. If the given string is longer than PATH_MAX, i.e. 4096 as far as
>>    the kernel is concerned, then the getname() helper will fail and
>>    the kernel will return -ENAMETOOLONG right away.
>>
>> 2. If the string fits in PATH_MAX, but the filesystem rejects the
>>    path name, for instance because one of its components is longer
>>    than the support file name length (e.g. 255 for ext4).
> Ideally we should have at least one test that would hit the 1. as well...

This is what patch 3 is meant to achieve: instead of hitting 2. we now
systematically hit 1.

Thanks for merging this series (so quickly)!

Kevin


More information about the ltp mailing list