[LTP] [PATCH] fanotify22: Make 'dev' the last debugfs argument for musl compat

Florian Schmaus florian.schmaus@codasip.com
Mon Jul 14 18:50:28 CEST 2025


On 15/07/2025 03.19, Wei Gao wrote:
> [You don't often get email from wegao@suse.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> On Fri, Jul 11, 2025 at 06:55:58PM +0200, Florian Schmaus via ltp wrote:
>> The debugfs(8) man page specifies that the device to operate on should
>> be the last argument. So instead of
>>
>> debugfs -w /dev/loop2 -R "sif internal_dir/bad_dir mode 0xff"
>>
>> the correct command line invocation would be
>>
>> debugfs -w -R "sif internal_dir/bad_dir mode 0xff" /dev/loop2
>>
>> The former works on glibc-based systems, due to glibc's optind
>> handling. However, it breaks on musl-based systems, where the
>> fanotify22 test will hang because debugfs is awaiting user input.
>>
>> Signed-off-by: Florian Schmaus <florian.schmaus@codasip.com>
>> ---
>>   testcases/kernel/syscalls/fanotify/fanotify22.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/testcases/kernel/syscalls/fanotify/fanotify22.c
>> b/testcases/kernel/syscalls/fanotify/fanotify22.c
>> index 20c7a6aca243..357e74dbc702 100644
>> --- a/testcases/kernel/syscalls/fanotify/fanotify22.c
>> +++ b/testcases/kernel/syscalls/fanotify/fanotify22.c
>> @@ -61,7 +61,7 @@ static void trigger_fs_abort(void)
>>    static void do_debugfs_request(const char *dev, char *request)
>>   {
>> -     const char *const cmd[] = {"debugfs", "-w", dev, "-R", request, NULL};
>> +     const char *const cmd[] = {"debugfs", "-w", "-R", request, dev, NULL};
>>        SAFE_CMD(cmd, NULL, NULL);
>>   }
>> --
>> 2.49.1
>>
> Thanks for your patch.


Thanks for your response.


> 
> CI give following error, i think diff header has format issue need
> fixed. BTW you another patch seems has same issue.
> 
> error: git diff header lacks filename information when removing 1 leading pathname component (line 6)
> hint: Use 'git am --show-current-patch=diff' to see the failed patch

You are right. Something added an additional line break along the way to 
you. The "diff --git a/testcases/…" should be one line instead of two.

I'll try to fix the mail setup and resend. Sorry for the inconvenience.

- Florian


More information about the ltp mailing list