[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20240203164230.149317-1-jain.abhinav177@gmail.com>
Date: Sat, 3 Feb 2024 16:42:30 +0000
From: Abhinav Jain <jain.abhinav177@...il.com>
To: skhan@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org,
Abhinav Jain <jain.abhinav177@...il.com>
Subject: [PATCH] Task: Kselftests: LKMP Bug Fixing Spring 2024
-Added <stddef.h> header to fix implicit declaration warnings
-Added ksft_exit_fail_msg() return value checks for fchdir and chroot
Signed-off-by: Abhinav Jain <jain.abhinav177@...il.com>
---
.../filesystems/statmount/statmount_test.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/filesystems/statmount/statmount_test.c b/tools/testing/selftests/filesystems/statmount/statmount_test.c
index 3eafd7da58e2..47ee57da9942 100644
--- a/tools/testing/selftests/filesystems/statmount/statmount_test.c
+++ b/tools/testing/selftests/filesystems/statmount/statmount_test.c
@@ -124,8 +124,17 @@ static uint32_t old_root_id, old_parent_id;
static void cleanup_namespace(void)
{
- fchdir(orig_root);
- chroot(".");
+ int ret;
+
+ ret = fchdir(orig_root);
+ if (ret == -1)
+ ksft_exit_fail_msg("changing current directory: %s\n",
+ strerror(errno));
+
+ ret = chroot(".");
+ if (ret == -1)
+ ksft_exit_fail_msg("chroot: %s\n", strerror(errno));
+
umount2(root_mntpoint, MNT_DETACH);
rmdir(root_mntpoint);
}
--
2.25.1
Powered by blists - more mailing lists