Skip to contentSkip to conversation

selftests: Add missing <sys/syscall.h> to mount_setattr test

PATCH In review Daan De Meyer 3 participants 3 messages Dec 1, 2022 – Dec 20, 2022

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

PATCH 1/1 selftests: Add missing <sys/syscall.h> to mount_setattr test

Including <sys/syscall.h> is required to define __NR_mount_setattr and __NR_open_tree which the mount_setattr test relies on.

---
 tools/testing/selftests/mount_setattr/mount_setattr_test.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/mount_setattr/mount_setattr_test.c +1 -0
index 8c5fea68ae67..da85f8af482c 100644
@@ -11,6 +11,7 @@
 #include <sys/wait.h>
 #include <sys/vfs.h>
 #include <sys/statvfs.h>
+#include <sys/syscall.h>
 #include <sys/sysinfo.h>
 #include <stdlib.h>
 #include <unistd.h>
Signature · 1 line
2.38.1
Tested-by on v1 1/1
#2 lore raw
In reply to Daan De Meyer
Quoted 13 lines · Daan De Meyer

Including <sys/syscall.h> is required to define __NR_mount_setattr and __NR_open_tree which the mount_setattr test relies on.

---
 tools/testing/selftests/mount_setattr/mount_setattr_test.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/mount_setattr/mount_setattr_test.c +0 -0
index 8c5fea68ae67..da85f8af482c 100644

tools/testing/selftests/mount_setattr/mount_setattr_test.c line 17

Quoted 7 lines
tools/testing/selftests/mount_setattr/mount_setattr_test.c +1 -0
@@ -11,6 +11,7 @@
 #include <sys/wait.h>
 #include <sys/vfs.h>
 #include <sys/statvfs.h>
+#include <sys/syscall.h>
 #include <sys/sysinfo.h>
 #include <stdlib.h>
 #include <unistd.h>

Though this oversight actually led to gcc detecting another another error [1], as it entered the #ifndef __NR_mount_setattr block.

Thanks,
Siddh

[1] https://lore.kernel.org/all/[email protected]/