linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/fs/mount-notify: Fix compilation failure.
@ 2025-08-13  3:16 Xing Guo
  2025-08-13  6:04 ` Xing Guo
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Xing Guo @ 2025-08-13  3:16 UTC (permalink / raw)
  To: linux-kselftest; +Cc: shuah, jhubbard, amir73il, Xing Guo

Commit c6d9775c2066 ("selftests/fs/mount-notify: build with tools include
dir") introduces the struct __kernel_fsid_t to decouple dependency with
headers_install.  The commit forgets to define a macro for __kernel_fsid_t
and it will cause type re-definition issue.

Signed-off-by: Xing Guo <higuoxing@gmail.com>
---
 .../mount-notify/mount-notify_test.c           | 17 ++++++++---------
 .../mount-notify/mount-notify_test_ns.c        | 18 ++++++++----------
 2 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c
index 63ce708d93ed..e4b7c2b457ee 100644
--- a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c
+++ b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c
@@ -2,6 +2,13 @@
 // Copyright (c) 2025 Miklos Szeredi <miklos@szeredi.hu>
 
 #define _GNU_SOURCE
+
+// Needed for linux/fanotify.h
+typedef struct {
+	int	val[2];
+} __kernel_fsid_t;
+#define __kernel_fsid_t __kernel_fsid_t
+
 #include <fcntl.h>
 #include <sched.h>
 #include <stdio.h>
@@ -10,20 +17,12 @@
 #include <sys/mount.h>
 #include <unistd.h>
 #include <sys/syscall.h>
+#include <sys/fanotify.h>
 
 #include "../../kselftest_harness.h"
 #include "../statmount/statmount.h"
 #include "../utils.h"
 
-// Needed for linux/fanotify.h
-#ifndef __kernel_fsid_t
-typedef struct {
-	int	val[2];
-} __kernel_fsid_t;
-#endif
-
-#include <sys/fanotify.h>
-
 static const char root_mntpoint_templ[] = "/tmp/mount-notify_test_root.XXXXXX";
 
 static const int mark_cmds[] = {
diff --git a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
index 090a5ca65004..9f57ca46e3af 100644
--- a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
+++ b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
@@ -2,6 +2,13 @@
 // Copyright (c) 2025 Miklos Szeredi <miklos@szeredi.hu>
 
 #define _GNU_SOURCE
+
+// Needed for linux/fanotify.h
+typedef struct {
+	int	val[2];
+} __kernel_fsid_t;
+#define __kernel_fsid_t __kernel_fsid_t
+
 #include <fcntl.h>
 #include <sched.h>
 #include <stdio.h>
@@ -10,21 +17,12 @@
 #include <sys/mount.h>
 #include <unistd.h>
 #include <sys/syscall.h>
+#include <sys/fanotify.h>
 
 #include "../../kselftest_harness.h"
-#include "../../pidfd/pidfd.h"
 #include "../statmount/statmount.h"
 #include "../utils.h"
 
-// Needed for linux/fanotify.h
-#ifndef __kernel_fsid_t
-typedef struct {
-	int	val[2];
-} __kernel_fsid_t;
-#endif
-
-#include <sys/fanotify.h>
-
 static const char root_mntpoint_templ[] = "/tmp/mount-notify_test_root.XXXXXX";
 
 static const int mark_types[] = {
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] selftests/fs/mount-notify: Fix compilation failure.
  2025-08-13  3:16 [PATCH] selftests/fs/mount-notify: Fix compilation failure Xing Guo
@ 2025-08-13  6:04 ` Xing Guo
  2025-08-13  6:36 ` Amir Goldstein
  2025-09-02  8:35 ` Christian Brauner
  2 siblings, 0 replies; 8+ messages in thread
From: Xing Guo @ 2025-08-13  6:04 UTC (permalink / raw)
  To: linux-kselftest; +Cc: shuah, jhubbard, amir73il

Sorry, I forget to attach the error message in my previous email.

CC       mount-notify_test_ns
mount-notify_test_ns.c:23:3: error: conflicting types for
‘__kernel_fsid_t’; have ‘struct <anonymous>’
   23 | } __kernel_fsid_t;
      |   ^~~~~~~~~~~~~~~
In file included from /tmp/kselftest/usr/include/asm/posix_types_64.h:18,
                 from /tmp/kselftest/usr/include/asm/posix_types.h:7,
                 from /tmp/kselftest/usr/include/linux/posix_types.h:36,
                 from /tmp/kselftest/usr/include/linux/types.h:9,
                 from /tmp/kselftest/usr/include/linux/sched/types.h:5,
                 from /usr/include/bits/sched.h:63,
                 from /usr/include/sched.h:43,
                 from mount-notify_test_ns.c:6:
/tmp/kselftest/usr/include/asm-generic/posix_types.h:81:3: note:
previous declaration of ‘__kernel_fsid_t’ with type ‘__kernel_fsid_t’
   81 | } __kernel_fsid_t;
      |   ^~~~~~~~~~~~~~~
make[1]: *** [../../lib.mk:222:
/tmp/kselftest/kselftest/filesystems/mount-notify/mount-notify_test_ns]
Error 1
make[1]: Nothing to be done for 'all'.

Best Regards,
Xing






On Wed, Aug 13, 2025 at 11:17 AM Xing Guo <higuoxing@gmail.com> wrote:
>
> Commit c6d9775c2066 ("selftests/fs/mount-notify: build with tools include
> dir") introduces the struct __kernel_fsid_t to decouple dependency with
> headers_install.  The commit forgets to define a macro for __kernel_fsid_t
> and it will cause type re-definition issue.
>
> Signed-off-by: Xing Guo <higuoxing@gmail.com>
> ---
>  .../mount-notify/mount-notify_test.c           | 17 ++++++++---------
>  .../mount-notify/mount-notify_test_ns.c        | 18 ++++++++----------
>  2 files changed, 16 insertions(+), 19 deletions(-)
>
> diff --git a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c
> index 63ce708d93ed..e4b7c2b457ee 100644
> --- a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c
> +++ b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c
> @@ -2,6 +2,13 @@
>  // Copyright (c) 2025 Miklos Szeredi <miklos@szeredi.hu>
>
>  #define _GNU_SOURCE
> +
> +// Needed for linux/fanotify.h
> +typedef struct {
> +       int     val[2];
> +} __kernel_fsid_t;
> +#define __kernel_fsid_t __kernel_fsid_t
> +
>  #include <fcntl.h>
>  #include <sched.h>
>  #include <stdio.h>
> @@ -10,20 +17,12 @@
>  #include <sys/mount.h>
>  #include <unistd.h>
>  #include <sys/syscall.h>
> +#include <sys/fanotify.h>
>
>  #include "../../kselftest_harness.h"
>  #include "../statmount/statmount.h"
>  #include "../utils.h"
>
> -// Needed for linux/fanotify.h
> -#ifndef __kernel_fsid_t
> -typedef struct {
> -       int     val[2];
> -} __kernel_fsid_t;
> -#endif
> -
> -#include <sys/fanotify.h>
> -
>  static const char root_mntpoint_templ[] = "/tmp/mount-notify_test_root.XXXXXX";
>
>  static const int mark_cmds[] = {
> diff --git a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
> index 090a5ca65004..9f57ca46e3af 100644
> --- a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
> +++ b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
> @@ -2,6 +2,13 @@
>  // Copyright (c) 2025 Miklos Szeredi <miklos@szeredi.hu>
>
>  #define _GNU_SOURCE
> +
> +// Needed for linux/fanotify.h
> +typedef struct {
> +       int     val[2];
> +} __kernel_fsid_t;
> +#define __kernel_fsid_t __kernel_fsid_t
> +
>  #include <fcntl.h>
>  #include <sched.h>
>  #include <stdio.h>
> @@ -10,21 +17,12 @@
>  #include <sys/mount.h>
>  #include <unistd.h>
>  #include <sys/syscall.h>
> +#include <sys/fanotify.h>
>
>  #include "../../kselftest_harness.h"
> -#include "../../pidfd/pidfd.h"
>  #include "../statmount/statmount.h"
>  #include "../utils.h"
>
> -// Needed for linux/fanotify.h
> -#ifndef __kernel_fsid_t
> -typedef struct {
> -       int     val[2];
> -} __kernel_fsid_t;
> -#endif
> -
> -#include <sys/fanotify.h>
> -
>  static const char root_mntpoint_templ[] = "/tmp/mount-notify_test_root.XXXXXX";
>
>  static const int mark_types[] = {
> --
> 2.50.1
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] selftests/fs/mount-notify: Fix compilation failure.
  2025-08-13  3:16 [PATCH] selftests/fs/mount-notify: Fix compilation failure Xing Guo
  2025-08-13  6:04 ` Xing Guo
@ 2025-08-13  6:36 ` Amir Goldstein
  2025-08-13  6:39   ` Amir Goldstein
  2025-09-02  8:35 ` Christian Brauner
  2 siblings, 1 reply; 8+ messages in thread
From: Amir Goldstein @ 2025-08-13  6:36 UTC (permalink / raw)
  To: Xing Guo; +Cc: linux-kselftest, shuah, jhubbard

On Wed, Aug 13, 2025 at 5:17 AM Xing Guo <higuoxing@gmail.com> wrote:
>
> Commit c6d9775c2066 ("selftests/fs/mount-notify: build with tools include
> dir") introduces the struct __kernel_fsid_t to decouple dependency with
> headers_install.  The commit forgets to define a macro for __kernel_fsid_t
> and it will cause type re-definition issue.
>
> Signed-off-by: Xing Guo <higuoxing@gmail.com>

Thank you for fixing this!

Acked-by: Amir Goldstein <amir73il@gmail.com>

> ---
>  .../mount-notify/mount-notify_test.c           | 17 ++++++++---------
>  .../mount-notify/mount-notify_test_ns.c        | 18 ++++++++----------
>  2 files changed, 16 insertions(+), 19 deletions(-)
>
> diff --git a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c
> index 63ce708d93ed..e4b7c2b457ee 100644
> --- a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c
> +++ b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c
> @@ -2,6 +2,13 @@
>  // Copyright (c) 2025 Miklos Szeredi <miklos@szeredi.hu>
>
>  #define _GNU_SOURCE
> +
> +// Needed for linux/fanotify.h
> +typedef struct {
> +       int     val[2];
> +} __kernel_fsid_t;
> +#define __kernel_fsid_t __kernel_fsid_t
> +
>  #include <fcntl.h>
>  #include <sched.h>
>  #include <stdio.h>
> @@ -10,20 +17,12 @@
>  #include <sys/mount.h>
>  #include <unistd.h>
>  #include <sys/syscall.h>
> +#include <sys/fanotify.h>
>
>  #include "../../kselftest_harness.h"
>  #include "../statmount/statmount.h"
>  #include "../utils.h"
>
> -// Needed for linux/fanotify.h
> -#ifndef __kernel_fsid_t
> -typedef struct {
> -       int     val[2];
> -} __kernel_fsid_t;
> -#endif
> -
> -#include <sys/fanotify.h>
> -
>  static const char root_mntpoint_templ[] = "/tmp/mount-notify_test_root.XXXXXX";
>
>  static const int mark_cmds[] = {
> diff --git a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
> index 090a5ca65004..9f57ca46e3af 100644
> --- a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
> +++ b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
> @@ -2,6 +2,13 @@
>  // Copyright (c) 2025 Miklos Szeredi <miklos@szeredi.hu>
>
>  #define _GNU_SOURCE
> +
> +// Needed for linux/fanotify.h
> +typedef struct {
> +       int     val[2];
> +} __kernel_fsid_t;
> +#define __kernel_fsid_t __kernel_fsid_t
> +
>  #include <fcntl.h>
>  #include <sched.h>
>  #include <stdio.h>
> @@ -10,21 +17,12 @@
>  #include <sys/mount.h>
>  #include <unistd.h>
>  #include <sys/syscall.h>
> +#include <sys/fanotify.h>
>
>  #include "../../kselftest_harness.h"
> -#include "../../pidfd/pidfd.h"
>  #include "../statmount/statmount.h"
>  #include "../utils.h"
>
> -// Needed for linux/fanotify.h
> -#ifndef __kernel_fsid_t
> -typedef struct {
> -       int     val[2];
> -} __kernel_fsid_t;
> -#endif
> -
> -#include <sys/fanotify.h>
> -
>  static const char root_mntpoint_templ[] = "/tmp/mount-notify_test_root.XXXXXX";
>
>  static const int mark_types[] = {
> --
> 2.50.1
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] selftests/fs/mount-notify: Fix compilation failure.
  2025-08-13  6:36 ` Amir Goldstein
@ 2025-08-13  6:39   ` Amir Goldstein
  2025-08-13  7:55     ` Xing Guo
  0 siblings, 1 reply; 8+ messages in thread
From: Amir Goldstein @ 2025-08-13  6:39 UTC (permalink / raw)
  To: Xing Guo
  Cc: linux-kselftest, shuah, jhubbard, Christian Brauner, Jan Kara,
	Miklos Szeredi, linux-fsdevel

On Wed, Aug 13, 2025 at 8:36 AM Amir Goldstein <amir73il@gmail.com> wrote:
>
> On Wed, Aug 13, 2025 at 5:17 AM Xing Guo <higuoxing@gmail.com> wrote:
> >
> > Commit c6d9775c2066 ("selftests/fs/mount-notify: build with tools include
> > dir") introduces the struct __kernel_fsid_t to decouple dependency with
> > headers_install.  The commit forgets to define a macro for __kernel_fsid_t
> > and it will cause type re-definition issue.
> >
> > Signed-off-by: Xing Guo <higuoxing@gmail.com>
>
> Thank you for fixing this!
>
> Acked-by: Amir Goldstein <amir73il@gmail.com>
>

You should probably also add:

Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202508110628.65069d92-lkp@intel.com

Thanks,
Amir,

> > ---
> >  .../mount-notify/mount-notify_test.c           | 17 ++++++++---------
> >  .../mount-notify/mount-notify_test_ns.c        | 18 ++++++++----------
> >  2 files changed, 16 insertions(+), 19 deletions(-)
> >
> > diff --git a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c
> > index 63ce708d93ed..e4b7c2b457ee 100644
> > --- a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c
> > +++ b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c
> > @@ -2,6 +2,13 @@
> >  // Copyright (c) 2025 Miklos Szeredi <miklos@szeredi.hu>
> >
> >  #define _GNU_SOURCE
> > +
> > +// Needed for linux/fanotify.h
> > +typedef struct {
> > +       int     val[2];
> > +} __kernel_fsid_t;
> > +#define __kernel_fsid_t __kernel_fsid_t
> > +
> >  #include <fcntl.h>
> >  #include <sched.h>
> >  #include <stdio.h>
> > @@ -10,20 +17,12 @@
> >  #include <sys/mount.h>
> >  #include <unistd.h>
> >  #include <sys/syscall.h>
> > +#include <sys/fanotify.h>
> >
> >  #include "../../kselftest_harness.h"
> >  #include "../statmount/statmount.h"
> >  #include "../utils.h"
> >
> > -// Needed for linux/fanotify.h
> > -#ifndef __kernel_fsid_t
> > -typedef struct {
> > -       int     val[2];
> > -} __kernel_fsid_t;
> > -#endif
> > -
> > -#include <sys/fanotify.h>
> > -
> >  static const char root_mntpoint_templ[] = "/tmp/mount-notify_test_root.XXXXXX";
> >
> >  static const int mark_cmds[] = {
> > diff --git a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
> > index 090a5ca65004..9f57ca46e3af 100644
> > --- a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
> > +++ b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
> > @@ -2,6 +2,13 @@
> >  // Copyright (c) 2025 Miklos Szeredi <miklos@szeredi.hu>
> >
> >  #define _GNU_SOURCE
> > +
> > +// Needed for linux/fanotify.h
> > +typedef struct {
> > +       int     val[2];
> > +} __kernel_fsid_t;
> > +#define __kernel_fsid_t __kernel_fsid_t
> > +
> >  #include <fcntl.h>
> >  #include <sched.h>
> >  #include <stdio.h>
> > @@ -10,21 +17,12 @@
> >  #include <sys/mount.h>
> >  #include <unistd.h>
> >  #include <sys/syscall.h>
> > +#include <sys/fanotify.h>
> >
> >  #include "../../kselftest_harness.h"
> > -#include "../../pidfd/pidfd.h"
> >  #include "../statmount/statmount.h"
> >  #include "../utils.h"
> >
> > -// Needed for linux/fanotify.h
> > -#ifndef __kernel_fsid_t
> > -typedef struct {
> > -       int     val[2];
> > -} __kernel_fsid_t;
> > -#endif
> > -
> > -#include <sys/fanotify.h>
> > -
> >  static const char root_mntpoint_templ[] = "/tmp/mount-notify_test_root.XXXXXX";
> >
> >  static const int mark_types[] = {
> > --
> > 2.50.1
> >

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] selftests/fs/mount-notify: Fix compilation failure.
  2025-08-13  6:39   ` Amir Goldstein
@ 2025-08-13  7:55     ` Xing Guo
  2025-09-01 17:17       ` Jan Kara
  0 siblings, 1 reply; 8+ messages in thread
From: Xing Guo @ 2025-08-13  7:55 UTC (permalink / raw)
  To: amir73il
  Cc: brauner, higuoxing, jack, jhubbard, linux-fsdevel,
	linux-kselftest, miklos, shuah, kernel test robot

Commit c6d9775c2066 ("selftests/fs/mount-notify: build with tools include
dir") introduces the struct __kernel_fsid_t to decouple dependency with
headers_install.  The commit forgets to define a macro for __kernel_fsid_t
and it will cause type re-definition issue.

Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202508110628.65069d92-lkp@intel.com
Signed-off-by: Xing Guo <higuoxing@gmail.com>
Acked-by: Amir Goldstein <amir73il@gmail.com>
---
 .../mount-notify/mount-notify_test.c           | 17 ++++++++---------
 .../mount-notify/mount-notify_test_ns.c        | 18 ++++++++----------
 2 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c
index 63ce708d93ed..e4b7c2b457ee 100644
--- a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c
+++ b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c
@@ -2,6 +2,13 @@
 // Copyright (c) 2025 Miklos Szeredi <miklos@szeredi.hu>
 
 #define _GNU_SOURCE
+
+// Needed for linux/fanotify.h
+typedef struct {
+	int	val[2];
+} __kernel_fsid_t;
+#define __kernel_fsid_t __kernel_fsid_t
+
 #include <fcntl.h>
 #include <sched.h>
 #include <stdio.h>
@@ -10,20 +17,12 @@
 #include <sys/mount.h>
 #include <unistd.h>
 #include <sys/syscall.h>
+#include <sys/fanotify.h>
 
 #include "../../kselftest_harness.h"
 #include "../statmount/statmount.h"
 #include "../utils.h"
 
-// Needed for linux/fanotify.h
-#ifndef __kernel_fsid_t
-typedef struct {
-	int	val[2];
-} __kernel_fsid_t;
-#endif
-
-#include <sys/fanotify.h>
-
 static const char root_mntpoint_templ[] = "/tmp/mount-notify_test_root.XXXXXX";
 
 static const int mark_cmds[] = {
diff --git a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
index 090a5ca65004..9f57ca46e3af 100644
--- a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
+++ b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
@@ -2,6 +2,13 @@
 // Copyright (c) 2025 Miklos Szeredi <miklos@szeredi.hu>
 
 #define _GNU_SOURCE
+
+// Needed for linux/fanotify.h
+typedef struct {
+	int	val[2];
+} __kernel_fsid_t;
+#define __kernel_fsid_t __kernel_fsid_t
+
 #include <fcntl.h>
 #include <sched.h>
 #include <stdio.h>
@@ -10,21 +17,12 @@
 #include <sys/mount.h>
 #include <unistd.h>
 #include <sys/syscall.h>
+#include <sys/fanotify.h>
 
 #include "../../kselftest_harness.h"
-#include "../../pidfd/pidfd.h"
 #include "../statmount/statmount.h"
 #include "../utils.h"
 
-// Needed for linux/fanotify.h
-#ifndef __kernel_fsid_t
-typedef struct {
-	int	val[2];
-} __kernel_fsid_t;
-#endif
-
-#include <sys/fanotify.h>
-
 static const char root_mntpoint_templ[] = "/tmp/mount-notify_test_root.XXXXXX";
 
 static const int mark_types[] = {
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] selftests/fs/mount-notify: Fix compilation failure.
  2025-08-13  7:55     ` Xing Guo
@ 2025-09-01 17:17       ` Jan Kara
  2025-09-02  8:36         ` Christian Brauner
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Kara @ 2025-09-01 17:17 UTC (permalink / raw)
  To: brauner
  Cc: Xing Guo, amir73il, jack, jhubbard, linux-fsdevel,
	linux-kselftest, miklos, shuah, kernel test robot

On Wed 13-08-25 15:55:23, Xing Guo wrote:
> Commit c6d9775c2066 ("selftests/fs/mount-notify: build with tools include
> dir") introduces the struct __kernel_fsid_t to decouple dependency with
> headers_install.  The commit forgets to define a macro for __kernel_fsid_t
> and it will cause type re-definition issue.
> 
> Reported-by: kernel test robot <oliver.sang@intel.com>
> Closes: https://lore.kernel.org/oe-lkp/202508110628.65069d92-lkp@intel.com
> Signed-off-by: Xing Guo <higuoxing@gmail.com>
> Acked-by: Amir Goldstein <amir73il@gmail.com>

Christian, quick search didn't find this patch in your tree. Any reason you
didn't pick it up?

								Honza

> ---
>  .../mount-notify/mount-notify_test.c           | 17 ++++++++---------
>  .../mount-notify/mount-notify_test_ns.c        | 18 ++++++++----------
>  2 files changed, 16 insertions(+), 19 deletions(-)
> 
> diff --git a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c
> index 63ce708d93ed..e4b7c2b457ee 100644
> --- a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c
> +++ b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c
> @@ -2,6 +2,13 @@
>  // Copyright (c) 2025 Miklos Szeredi <miklos@szeredi.hu>
>  
>  #define _GNU_SOURCE
> +
> +// Needed for linux/fanotify.h
> +typedef struct {
> +	int	val[2];
> +} __kernel_fsid_t;
> +#define __kernel_fsid_t __kernel_fsid_t
> +
>  #include <fcntl.h>
>  #include <sched.h>
>  #include <stdio.h>
> @@ -10,20 +17,12 @@
>  #include <sys/mount.h>
>  #include <unistd.h>
>  #include <sys/syscall.h>
> +#include <sys/fanotify.h>
>  
>  #include "../../kselftest_harness.h"
>  #include "../statmount/statmount.h"
>  #include "../utils.h"
>  
> -// Needed for linux/fanotify.h
> -#ifndef __kernel_fsid_t
> -typedef struct {
> -	int	val[2];
> -} __kernel_fsid_t;
> -#endif
> -
> -#include <sys/fanotify.h>
> -
>  static const char root_mntpoint_templ[] = "/tmp/mount-notify_test_root.XXXXXX";
>  
>  static const int mark_cmds[] = {
> diff --git a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
> index 090a5ca65004..9f57ca46e3af 100644
> --- a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
> +++ b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
> @@ -2,6 +2,13 @@
>  // Copyright (c) 2025 Miklos Szeredi <miklos@szeredi.hu>
>  
>  #define _GNU_SOURCE
> +
> +// Needed for linux/fanotify.h
> +typedef struct {
> +	int	val[2];
> +} __kernel_fsid_t;
> +#define __kernel_fsid_t __kernel_fsid_t
> +
>  #include <fcntl.h>
>  #include <sched.h>
>  #include <stdio.h>
> @@ -10,21 +17,12 @@
>  #include <sys/mount.h>
>  #include <unistd.h>
>  #include <sys/syscall.h>
> +#include <sys/fanotify.h>
>  
>  #include "../../kselftest_harness.h"
> -#include "../../pidfd/pidfd.h"
>  #include "../statmount/statmount.h"
>  #include "../utils.h"
>  
> -// Needed for linux/fanotify.h
> -#ifndef __kernel_fsid_t
> -typedef struct {
> -	int	val[2];
> -} __kernel_fsid_t;
> -#endif
> -
> -#include <sys/fanotify.h>
> -
>  static const char root_mntpoint_templ[] = "/tmp/mount-notify_test_root.XXXXXX";
>  
>  static const int mark_types[] = {
> -- 
> 2.50.1
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] selftests/fs/mount-notify: Fix compilation failure.
  2025-08-13  3:16 [PATCH] selftests/fs/mount-notify: Fix compilation failure Xing Guo
  2025-08-13  6:04 ` Xing Guo
  2025-08-13  6:36 ` Amir Goldstein
@ 2025-09-02  8:35 ` Christian Brauner
  2 siblings, 0 replies; 8+ messages in thread
From: Christian Brauner @ 2025-09-02  8:35 UTC (permalink / raw)
  To: linux-kselftest, Xing Guo; +Cc: Christian Brauner, shuah, jhubbard, amir73il

On Wed, 13 Aug 2025 11:16:47 +0800, Xing Guo wrote:
> Commit c6d9775c2066 ("selftests/fs/mount-notify: build with tools include
> dir") introduces the struct __kernel_fsid_t to decouple dependency with
> headers_install.  The commit forgets to define a macro for __kernel_fsid_t
> and it will cause type re-definition issue.
> 
> 

Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes

[1/1] selftests/fs/mount-notify: Fix compilation failure.
      https://git.kernel.org/vfs/vfs/c/e51bd0e59547
[1/1] selftests/fs/mount-notify: Fix compilation failure.
      https://git.kernel.org/vfs/vfs/c/e51bd0e59547

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] selftests/fs/mount-notify: Fix compilation failure.
  2025-09-01 17:17       ` Jan Kara
@ 2025-09-02  8:36         ` Christian Brauner
  0 siblings, 0 replies; 8+ messages in thread
From: Christian Brauner @ 2025-09-02  8:36 UTC (permalink / raw)
  To: Jan Kara
  Cc: Xing Guo, amir73il, jhubbard, linux-fsdevel, linux-kselftest,
	miklos, shuah, kernel test robot

On Mon, Sep 01, 2025 at 07:17:07PM +0200, Jan Kara wrote:
> On Wed 13-08-25 15:55:23, Xing Guo wrote:
> > Commit c6d9775c2066 ("selftests/fs/mount-notify: build with tools include
> > dir") introduces the struct __kernel_fsid_t to decouple dependency with
> > headers_install.  The commit forgets to define a macro for __kernel_fsid_t
> > and it will cause type re-definition issue.
> > 
> > Reported-by: kernel test robot <oliver.sang@intel.com>
> > Closes: https://lore.kernel.org/oe-lkp/202508110628.65069d92-lkp@intel.com
> > Signed-off-by: Xing Guo <higuoxing@gmail.com>
> > Acked-by: Amir Goldstein <amir73il@gmail.com>
> 
> Christian, quick search didn't find this patch in your tree. Any reason you
> didn't pick it up?

Weird. Thanks for the reminder, Jan! Picked into vfs.fixes now!

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-09-02  8:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-13  3:16 [PATCH] selftests/fs/mount-notify: Fix compilation failure Xing Guo
2025-08-13  6:04 ` Xing Guo
2025-08-13  6:36 ` Amir Goldstein
2025-08-13  6:39   ` Amir Goldstein
2025-08-13  7:55     ` Xing Guo
2025-09-01 17:17       ` Jan Kara
2025-09-02  8:36         ` Christian Brauner
2025-09-02  8:35 ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).