diff mbox series

[v2,1/1] selftests mount: Fix mount_setattr_test builds failed

Message ID 20230324021415.17416-1-tuananhlfc@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series [v2,1/1] selftests mount: Fix mount_setattr_test builds failed | expand

Commit Message

Anh Tuan Phan March 24, 2023, 2:14 a.m. UTC
When compiling selftests with target mount_setattr I encountered some errors with the below messages:
mount_setattr_test.c: In function ‘mount_setattr_thread’:
mount_setattr_test.c:343:16: error: variable ‘attr’ has initializer but incomplete type
  343 |         struct mount_attr attr = {
      |                ^~~~~~~~~~

These errors might be because of linux/mount.h is not included. This patch resolves that issue.

Signed-off-by: Anh Tuan Phan <tuananhlfc@gmail.com>
---
Thanks for replying so quickly, this is my first patch to the kernel. I
changed the include to use angle bracket as your suggestion.

 tools/testing/selftests/mount_setattr/mount_setattr_test.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Christian Brauner March 27, 2023, 8 a.m. UTC | #1
On Fri, Mar 24, 2023 at 09:14:15AM +0700, Anh Tuan Phan wrote:
> When compiling selftests with target mount_setattr I encountered some errors with the below messages:
> mount_setattr_test.c: In function ‘mount_setattr_thread’:
> mount_setattr_test.c:343:16: error: variable ‘attr’ has initializer but incomplete type
>   343 |         struct mount_attr attr = {
>       |                ^~~~~~~~~~
> 
> These errors might be because of linux/mount.h is not included. This patch resolves that issue.
> 
> Signed-off-by: Anh Tuan Phan <tuananhlfc@gmail.com>
> ---

I think Seth already acked this. This can go via the selftest tree,
Acked-by: Christian Brauner <brauner@kernel.org>
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 582669ca38e9..c6a8c732b802 100644
--- a/tools/testing/selftests/mount_setattr/mount_setattr_test.c
+++ b/tools/testing/selftests/mount_setattr/mount_setattr_test.c
@@ -18,6 +18,7 @@ 
 #include <grp.h>
 #include <stdbool.h>
 #include <stdarg.h>
+#include <linux/mount.h>
 
 #include "../kselftest_harness.h"