Unverified Commit e51bd0e5 authored by Xing Guo's avatar Xing Guo Committed by Christian Brauner
Browse files

selftests/fs/mount-notify: Fix compilation failure.



Commit c6d9775c ("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: default avatarXing Guo <higuoxing@gmail.com>
Link: https://lore.kernel.org/20250813031647.96411-1-higuoxing@gmail.com


Acked-by: default avatarAmir Goldstein <amir73il@gmail.com>
Closes: https://lore.kernel.org/oe-lkp/202508110628.65069d92-lkp@intel.com


Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent e23654f5
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
@@ -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[] = {
+8 −10
Original line number Diff line number Diff line
@@ -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[] = {