Skip to contentSkip to conversation

lib/tst_mkfs: bugfix for lib/tst_mkfs.c

PATCH New zhao gongyi 2 participants 2 messages Feb 18, 2021 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/tst_mkfs: bugfix for lib/tst_mkfs.c

Tmpfs is the only one filesystem in many embedded system, so LTP_DEV_FS_TYPE should be set to tmpfs in many testcases, for example syscalls/chown04, and in these cases, tests will be failed because there is no mkfs tool for tmpfs.

---
 lib/tst_mkfs.c | 5 +++++
 1 file changed, 5 insertions(+)
lib/tst_mkfs.c +5 -0
index 45dd83ad3..40141fead 100644
@@ -44,6 +44,11 @@ void tst_mkfs_(const char *file, const int lineno, void (cleanup_fn)(void),
 		return;
 	}
 
+	if (!strcmp(fs_type, "tmpfs")) {
+		tst_resm_(file, lineno, TINFO, "Need not fomat for TMPFS filesystem");
+		return;
+	}
+
 	snprintf(mkfs, sizeof(mkfs), "mkfs.%s", fs_type);
 
 	if (fs_opts) {

--
2.17.1

#1 lore raw

PATCH 1/1 lib/tst_mkfs: bugfix for lib/tst_mkfs.c

Hi!

lib/tst_mkfs.c void tst_mkfs_(const char *file, const int lineno, void (cleanup_fn)(void), · line 48

Quoted 2 lines
lib/tst_mkfs.c +2 -0
+	if (!strcmp(fs_type, "tmpfs")) {
+		tst_resm_(file, lineno, TINFO, "Need not fomat for TMPFS filesystem");

I've fixed typo and reworded this message a bit and pushed, thanks.

Signature · 2 lines
Cyril Hrubis
[email protected]