[LTP] [PATCH] fanotify22: Make 'dev' the last debugfs argument for musl compat
Andrea Cervesato
andrea.cervesato@suse.com
Tue Jul 22 12:11:26 CEST 2025
Hi!
On 7/15/25 11:19 AM, 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);
> }
I tested fanotify22 with buildroot using musl and the bug is indeed
present. This patch is correctly fixing the test, so I will merge it.
Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>
Thanks!
More information about the ltp
mailing list