[LTP] [PATCH] statx07: umount before un-export
Murphy Zhou
jencce.kernel@gmail.com
Wed Dec 21 08:58:21 CET 2022
We need to umount first, or there will be an umounted mountpoint
left behind.
Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com>
---
testcases/kernel/syscalls/statx/statx07.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/testcases/kernel/syscalls/statx/statx07.c b/testcases/kernel/syscalls/statx/statx07.c
index e1ae36a35..8cb3e9b6d 100644
--- a/testcases/kernel/syscalls/statx/statx07.c
+++ b/testcases/kernel/syscalls/statx/statx07.c
@@ -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 = {
--
2.31.1
More information about the ltp
mailing list