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

Wei Gao wegao@suse.com
Tue Jul 15 03:19:24 CEST 2025


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.

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

CI link: 
https://github.com/linux-test-project/ltp/actions/runs/16225674227/job/45816963576
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp


More information about the ltp mailing list