Skip to contentSkip to conversation

selftests: add missing include

PATCH RESEND In review Chen Linxuan 2 participants 4 messages Jun 10, 2025 – Jun 19, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 selftests: add missing include

I failed to build this test on Ubuntu 24.04.
Compiler complained about undefined functions mount, umount and some mount related flags.

---
 tools/testing/selftests/pid_namespace/pid_max.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/pid_namespace/pid_max.c +1 -0
index 96f274f0582b6..c3ee8a2eff75b 100644
@@ -12,6 +12,7 @@
 #include <syscall.h>
 #include <sys/mount.h>
 #include <sys/wait.h>
+#include <sys/mount.h>
 
 #include "../kselftest_harness.h"
 #include "../pidfd/pidfd.h"
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 14 lines · Chen Linxuan

I failed to build this test on Ubuntu 24.04.
Compiler complained about undefined functions mount, umount and some mount related flags.

---
  tools/testing/selftests/pid_namespace/pid_max.c | 1 +
  1 file changed, 1 insertion(+)
tools/testing/selftests/pid_namespace/pid_max.c +0 -0
index 96f274f0582b6..c3ee8a2eff75b 100644

tools/testing/selftests/pid_namespace/pid_max.c line 13

Quoted 2 lines
tools/testing/selftests/pid_namespace/pid_max.c +0 -0
@@ -12,6 +12,7 @@
  #include <syscall.h>
  #include <sys/mount.h>

Hmm. I see mount.h included here?

tools/testing/selftests/pid_namespace/pid_max.c line 15

Quoted 2 lines
tools/testing/selftests/pid_namespace/pid_max.c +1 -0
  #include <sys/wait.h>
+#include <sys/mount.h>

You are adding a duplicate include for the same file?

tools/testing/selftests/pid_namespace/pid_max.c line 18

Quoted 3 lines
tools/testing/selftests/pid_namespace/pid_max.c +0 -0
  #include "../kselftest_harness.h"
  #include "../pidfd/pidfd.h"

thanks,
-- Shuah

#2 lore raw
Quoted 11 lines · Shuah Khan
Quoted 9 lines · Chen Linxuan

I failed to build this test on Ubuntu 24.04.
Compiler complained about undefined functions mount, umount and some mount related flags.

---
  tools/testing/selftests/pid_namespace/pid_max.c | 1 +
  1 file changed, 1 insertion(+)
Quoted 9 lines

tools/testing/selftests/pid_namespace/pid_max.c line 13

Quoted 7 lines
tools/testing/selftests/pid_namespace/pid_max.c +0 -0
index 96f274f0582b6..c3ee8a2eff75b 100644
@@ -12,6 +12,7 @@
  #include <syscall.h>
  #include <sys/mount.h>

Hmm. I see mount.h included here?

我在重新发送补丁的时候犯了个错误,这个补丁之前就已经被合并了。抱歉。

Quoted 14 lines

tools/testing/selftests/pid_namespace/pid_max.c line 15

Quoted 3 lines
tools/testing/selftests/pid_namespace/pid_max.c +1 -0
  #include <sys/wait.h>
+#include <sys/mount.h>

You are adding a duplicate include for the same file?

tools/testing/selftests/pid_namespace/pid_max.c line 18

Quoted 3 lines
tools/testing/selftests/pid_namespace/pid_max.c +0 -0
  #include "../kselftest_harness.h"
  #include "../pidfd/pidfd.h"

thanks,
-- Shuah

#3 lore raw
In reply to Shuah Khan
Quoted 21 lines · Shuah Khan
Quoted 14 lines · Chen Linxuan

I failed to build this test on Ubuntu 24.04.
Compiler complained about undefined functions mount, umount and some mount related flags.

---
  tools/testing/selftests/pid_namespace/pid_max.c | 1 +
  1 file changed, 1 insertion(+)
tools/testing/selftests/pid_namespace/pid_max.c +0 -0
index 96f274f0582b6..c3ee8a2eff75b 100644

tools/testing/selftests/pid_namespace/pid_max.c line 13

Quoted 2 lines
tools/testing/selftests/pid_namespace/pid_max.c +0 -0
@@ -12,6 +12,7 @@
  #include <syscall.h>
  #include <sys/mount.h>

Hmm. I see mount.h included here?

Quoted 4 lines

tools/testing/selftests/pid_namespace/pid_max.c line 15

Quoted 2 lines
tools/testing/selftests/pid_namespace/pid_max.c +1 -0
  #include <sys/wait.h>
+#include <sys/mount.h>

You are adding a duplicate include for the same file?

I made a mistake when resending the patch; this patch has already been merged before. Sorry.

Quoted 9 lines

tools/testing/selftests/pid_namespace/pid_max.c line 18

Quoted 4 lines
tools/testing/selftests/pid_namespace/pid_max.c +0 -0
  #include "../kselftest_harness.h"
  #include "../pidfd/pidfd.h"

thanks,
-- Shuah