Skip to contentSkip to conversation

safe_mount: tolerate the realpath fails

LTP Li Wang 1 participant 1 message Jun 16, 2023 Library code

lore
Share & tools
lore

Li Wang

author
#0 lore raw

realpath() failure is not a fatal error in safe_mount, it's safe to tolerate them.

Follow-up-fix: 3490c2842b93bbde71168d8598d06f15ea5d4010

---
 lib/safe_macros.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/safe_macros.c +2 -2
index 037eb0e62..951e1b064 100644
@@ -905,7 +905,7 @@ int safe_mount(const char *file, const int lineno, void (*cleanup_fn)(void),
 			"Mounting %s to %s fstyp=%s flags=%lx",
 			source, mpath, filesystemtype, mountflags);
 	} else {
-		tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn,
+		tst_resm_(file, lineno, TINFO | TERRNO,
 			"Cannot resolve the absolute path of %s", target);
 	}
 	/*
@@ -962,7 +962,7 @@ int safe_umount(const char *file, const int lineno, void (*cleanup_fn)(void),
 	if (realpath(target, mpath)) {
 		tst_resm_(file, lineno, TINFO, "Umounting %s", mpath);
 	} else {
-		tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn,
+		tst_resm_(file, lineno, TINFO | TERRNO,
 			"Cannot resolve the absolute path of %s", target);
 	}
 
Signature · 5 lines
2.40.1


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