Skip to content

Commit e51bd0e

Browse files
higuoxingbrauner
authored andcommitted
selftests/fs/mount-notify: Fix compilation failure.
Commit c6d9775 ("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 <[email protected]> Link: https://lore.kernel.org/[email protected] Acked-by: Amir Goldstein <[email protected]> Closes: https://lore.kernel.org/oe-lkp/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent e23654f commit e51bd0e

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
// Copyright (c) 2025 Miklos Szeredi <[email protected]>
33

44
#define _GNU_SOURCE
5+
6+
// Needed for linux/fanotify.h
7+
typedef struct {
8+
int val[2];
9+
} __kernel_fsid_t;
10+
#define __kernel_fsid_t __kernel_fsid_t
11+
512
#include <fcntl.h>
613
#include <sched.h>
714
#include <stdio.h>
@@ -10,20 +17,12 @@
1017
#include <sys/mount.h>
1118
#include <unistd.h>
1219
#include <sys/syscall.h>
20+
#include <sys/fanotify.h>
1321

1422
#include "../../kselftest_harness.h"
1523
#include "../statmount/statmount.h"
1624
#include "../utils.h"
1725

18-
// Needed for linux/fanotify.h
19-
#ifndef __kernel_fsid_t
20-
typedef struct {
21-
int val[2];
22-
} __kernel_fsid_t;
23-
#endif
24-
25-
#include <sys/fanotify.h>
26-
2726
static const char root_mntpoint_templ[] = "/tmp/mount-notify_test_root.XXXXXX";
2827

2928
static const int mark_cmds[] = {

tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
// Copyright (c) 2025 Miklos Szeredi <[email protected]>
33

44
#define _GNU_SOURCE
5+
6+
// Needed for linux/fanotify.h
7+
typedef struct {
8+
int val[2];
9+
} __kernel_fsid_t;
10+
#define __kernel_fsid_t __kernel_fsid_t
11+
512
#include <fcntl.h>
613
#include <sched.h>
714
#include <stdio.h>
@@ -10,21 +17,12 @@
1017
#include <sys/mount.h>
1118
#include <unistd.h>
1219
#include <sys/syscall.h>
20+
#include <sys/fanotify.h>
1321

1422
#include "../../kselftest_harness.h"
15-
#include "../../pidfd/pidfd.h"
1623
#include "../statmount/statmount.h"
1724
#include "../utils.h"
1825

19-
// Needed for linux/fanotify.h
20-
#ifndef __kernel_fsid_t
21-
typedef struct {
22-
int val[2];
23-
} __kernel_fsid_t;
24-
#endif
25-
26-
#include <sys/fanotify.h>
27-
2826
static const char root_mntpoint_templ[] = "/tmp/mount-notify_test_root.XXXXXX";
2927

3028
static const int mark_types[] = {

0 commit comments

Comments
 (0)