Skip to contentSkip to conversation

statx07: umount before un-export

PATCH Applied Murphy Zhou 2 participants 2 messages Dec 21, 2022 – Dec 22, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 statx07: umount before un-export

We need to umount first, or there will be an umounted mountpoint left behind.

---
 testcases/kernel/syscalls/statx/statx07.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
testcases/kernel/syscalls/statx/statx07.c +3 -3
index e1ae36a35..8cb3e9b6d 100644
@@ -149,6 +149,9 @@ static void setup(void)
 
 static void cleanup(void)
 {
+	if (mounted)
+		SAFE_UMOUNT(CLI_PATH);
+
 	if (!exported)
 		return;
 	snprintf(cmd, sizeof(cmd),
@@ -156,9 +159,6 @@ static void cleanup(void)
 
 	if (tst_system(cmd) == -1)
 		tst_res(TWARN | TST_ERR, "failed to clear exportfs");
-
-	if (mounted)
-		SAFE_UMOUNT(CLI_PATH);
 }
 
 static struct tst_test test = {
Signature · 5 lines
2.31.1


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

Hello,

Quoted 2 lines · Murphy Zhou

We need to umount first, or there will be an umounted mountpoint left behind.

Merged, thanks!

Quoted 32 lines
---
 testcases/kernel/syscalls/statx/statx07.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
testcases/kernel/syscalls/statx/statx07.c +3 -3
index e1ae36a35..8cb3e9b6d 100644
@@ -149,6 +149,9 @@ static void setup(void)
 
 static void cleanup(void)
 {
+	if (mounted)
+		SAFE_UMOUNT(CLI_PATH);
+
 	if (!exported)
 		return;
 	snprintf(cmd, sizeof(cmd),
@@ -156,9 +159,6 @@ static void cleanup(void)
 
 	if (tst_system(cmd) == -1)
 		tst_res(TWARN | TST_ERR, "failed to clear exportfs");
-
-	if (mounted)
-		SAFE_UMOUNT(CLI_PATH);
 }
 
 static struct tst_test test = {
Signature · 1 line
2.31.1
Signature · 5 lines
Thank you,
Richard.

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