Skip to contentSkip to conversation

statmount09.c: Enable mnt_ns_id for STATMOUNT_MNT_NS_ID

PATCH In review Jack Morgan 2 participants 2 messages Sep 26, 2025 – Sep 29, 2025

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 statmount09.c: Enable mnt_ns_id for STATMOUNT_MNT_NS_ID

statmount09.c: Enable mnt_ns_id for STATMOUNT_MNT_NS_ID

When HAVE_STATMOUNT_MNT_NS_ID is defined, use mnt_ns_id for statmount09 test case. Otherswise, use mnt_id.

Fixes #1260
---
 testcases/kernel/syscalls/statmount/statmount09.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
testcases/kernel/syscalls/statmount/statmount09.c +5 -1
index 20c76ba24..03f54f2b8 100644
@@ -39,7 +39,11 @@ static void run(void)
 		return;
 
 	TST_EXP_EQ_LI(st_mount->mask, STATMOUNT_MNT_NS_ID);
-	TST_EXP_EQ_LI(st_mount->mnt_ns_id, mnt_ns_id);
+#if !defined(HAVE_STRUCT_STATMOUNT) || defined(HAVE_STRUCT_STATMOUNT_MNT_NS_ID)
+    TST_EXP_EQ_LI(st_mount->mnt_ns_id, mnt_ns_id);
+#else
+    tst_res(TCONF, "statmount.mnt_ns_id not available in current headers, skipping check");
+#endif
 }
 
 static void setup(void)

--
2.51.0

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

Hi!
Since we are nearing next release I pushed the patch with minor adjustenments, thanks!

Quoted 1 line

statmount09.c: Enable mnt_ns_id for STATMOUNT_MNT_NS_ID

I've removed this duplicate line.

Quoted 4 lines

When HAVE_STATMOUNT_MNT_NS_ID is defined, use mnt_ns_id for statmount09 test case. Otherswise, use mnt_id.

Fixes #1260

Replaced this with a full link to the issue (it's easier to dig things up that way).

Quoted 10 lines
---
 testcases/kernel/syscalls/statmount/statmount09.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
testcases/kernel/syscalls/statmount/statmount09.c +0 -0
index 20c76ba24..03f54f2b8 100644

testcases/kernel/syscalls/statmount/statmount09.c static void run(void) · line 45

Quoted 8 lines
testcases/kernel/syscalls/statmount/statmount09.c +4 -1
@@ -39,7 +39,11 @@ static void run(void)
 		return;
 
 	TST_EXP_EQ_LI(st_mount->mask, STATMOUNT_MNT_NS_ID);
-	TST_EXP_EQ_LI(st_mount->mnt_ns_id, mnt_ns_id);
+#if !defined(HAVE_STRUCT_STATMOUNT) || defined(HAVE_STRUCT_STATMOUNT_MNT_NS_ID)
+    TST_EXP_EQ_LI(st_mount->mnt_ns_id, mnt_ns_id);
+#else
+    tst_res(TCONF, "statmount.mnt_ns_id not available in current headers, skipping check");

Replaced the spaces with tabs, we use tabs in LTP (hint: 'make check' will print errors and warnings to catch such issues).

And also shortened the line a bit, the ", skipping check" part is redundand since the message type is TCONF already.

Signature · 5 lines
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp