diff mbox series

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

Message ID 20221201150218.2374366-1-daan.j.demeyer@gmail.com (mailing list archive)
State New, archived
Headers show
Series selftests: Add missing <sys/syscall.h> to mount_setattr test | expand

Commit Message

Daan De Meyer Dec. 1, 2022, 3:02 p.m. UTC
Including <sys/syscall.h> is required to define __NR_mount_setattr
and __NR_open_tree which the mount_setattr test relies on.

Signed-off-by: Daan De Meyer <daan.j.demeyer@gmail.com>
---
 tools/testing/selftests/mount_setattr/mount_setattr_test.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Christian Brauner Dec. 1, 2022, 3:49 p.m. UTC | #1
On Thu, Dec 01, 2022 at 04:02:18PM +0100, Daan De Meyer wrote:
> Including <sys/syscall.h> is required to define __NR_mount_setattr
> and __NR_open_tree which the mount_setattr test relies on.
> 
> Signed-off-by: Daan De Meyer <daan.j.demeyer@gmail.com>
> ---

Thanks for fixing this. Will pick this up now,
Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Siddh Raman Pant Dec. 20, 2022, 8:31 p.m. UTC | #2
On Thu, Dec 01 2022 at 20:32:18 +0530, Daan De Meyer wrote:
> Including <sys/syscall.h> is required to define __NR_mount_setattr
> and __NR_open_tree which the mount_setattr test relies on.
> 
> Signed-off-by: Daan De Meyer <daan.j.demeyer@gmail.com>
> ---
>  tools/testing/selftests/mount_setattr/mount_setattr_test.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/testing/selftests/mount_setattr/mount_setattr_test.c b/tools/testing/selftests/mount_setattr/mount_setattr_test.c
> index 8c5fea68ae67..da85f8af482c 100644
> --- a/tools/testing/selftests/mount_setattr/mount_setattr_test.c
> +++ b/tools/testing/selftests/mount_setattr/mount_setattr_test.c
> @@ -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>

Tested-by: Siddh Raman Pant <code@siddh.me>

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/20221211092820.85527-1-code@siddh.me/
diff mbox series

Patch

diff --git a/tools/testing/selftests/mount_setattr/mount_setattr_test.c b/tools/testing/selftests/mount_setattr/mount_setattr_test.c
index 8c5fea68ae67..da85f8af482c 100644
--- a/tools/testing/selftests/mount_setattr/mount_setattr_test.c
+++ b/tools/testing/selftests/mount_setattr/mount_setattr_test.c
@@ -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>