[LTP] [PATCH 1/2] statmount.h: add check for STATMOUNT_MNT_NS_ID

Cyril Hrubis chrubis@suse.cz
Mon Sep 15 11:06:05 CEST 2025


Hi!
> Enable mnt_ns_id check for kenels that support it
> It's can be deinfed as envornment variable with
> LTP_HAVE_STATMOUNT_MNT_NS_ID.
> 
> Fixes: #1260
> 
> Signed-off-by: Jack Morgan <jmorgan@naotchy.com>
> ---
>  testcases/kernel/syscalls/statmount/statmount.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/testcases/kernel/syscalls/statmount/statmount.h b/testcases/kernel/syscalls/statmount/statmount.h
> index d21d7f8da..b1696515d 100644
> --- a/testcases/kernel/syscalls/statmount/statmount.h
> +++ b/testcases/kernel/syscalls/statmount/statmount.h
> @@ -13,6 +13,11 @@
>  #include "lapi/syscalls.h"
>  #include "tst_safe_stdio.h"
> 
> +/* Enable mnt_ns_id check when system struct statmount is not defined. */
> +#if !defined(HAVE_STRUCT_STATMOUNT) && !defined(LTP_HAVE_STATMOUNT_MNT_NS_ID)
> +#define LTP_HAVE_STATMOUNT_MNT_NS_ID 1
> +#endif

We actually have a fallback definition for the statmount structure in
include/lapi/mount.h so the structure is always defined. So there is no
need for this and we can just do:

#if !defined(LTP_HAVE_STATMOUNT_MNT_NS_ID) \


in the test.

>  static inline int statmount(uint64_t mnt_id, uint64_t mask, struct statmount *buf,
>  		     size_t bufsize, unsigned int flags)
>  {
> --
> 2.51.0
> 
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list