public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/run_privatens: check if it is mount point for --make-private
@ 2025-03-03  6:42 Naohiro Aota
  2025-03-03 10:10 ` Zorro Lang
  0 siblings, 1 reply; 5+ messages in thread
From: Naohiro Aota @ 2025-03-03  6:42 UTC (permalink / raw)
  To: fstests; +Cc: Naohiro Aota

While /tmp is mounted with tmpfs in the most setup, it still can be a non-mount
point. For example, I'm running the fstests in a container, which does not
mount /tmp inside the container.

Running any test case on such system results in having the following error
printed, which leads to all the test cases fail due to the output difference.

  mount: /tmp: not mount point or bad option.
         dmesg(1) may have more information after failed mount system call.

These lines are printed by the "mount --make-private" command. So, fix that by
using mountpoint command to check if the directory is a mount point or not.

Fixes: 247ab01fa227 ("check: run tests in a private pid/mount namespace")
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
 tools/run_privatens | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/run_privatens b/tools/run_privatens
index df94974ab30c..c52e0128b8f9 100755
--- a/tools/run_privatens
+++ b/tools/run_privatens
@@ -8,7 +8,7 @@
 
 if [ -n "${FSTESTS_ISOL}" ]; then
 	for path in /proc /tmp; do
-		mount --make-private "$path"
+		mountpoint "$path" >/dev/null && mount --make-private "$path"
 	done
 	mount -t proc proc /proc
 	mount -t tmpfs tmpfs /tmp
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-03-04 18:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-03  6:42 [PATCH] tools/run_privatens: check if it is mount point for --make-private Naohiro Aota
2025-03-03 10:10 ` Zorro Lang
2025-03-03 13:29   ` Naohiro Aota
2025-03-04  1:38     ` Naohiro Aota
2025-03-04 18:03       ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox