public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/1] tst_test: Fix tests using device without .filesystems
@ 2024-07-09 10:33 Petr Vorel
  2024-07-09 11:05 ` Cyril Hrubis
  0 siblings, 1 reply; 6+ messages in thread
From: Petr Vorel @ 2024-07-09 10:33 UTC (permalink / raw)
  To: ltp

cce618891 introduced a regression for tests which use the test loop
device (e.g. .mount_device = 1 or .format_device = 1) without
.filesystems array (execveat03, ioctl04, inotify0[378], fanotify10,
mount02, umount0[1-3], umount2_02).

Call in that case prepare_device() with the default filesystem type.

Fixes: cce618891 ("lib: tst_test: Add per filesystem mkfs and mount opts")
Reported-by: Petr Cervinka <pcervinka@suse.com>
Suggested-by: Andrea Cervesato <andrea.cervesato@suse.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Hi,

is there a more elegant way to fix this?

Kind regards,
Petr

 lib/tst_test.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/tst_test.c b/lib/tst_test.c
index b49c248ae..6d258cd28 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -1355,8 +1355,11 @@ static void do_setup(int argc, char *argv[])
 
 		tdev.fs_type = default_fs_type();
 
-		if (!tst_test->all_filesystems && count_fs_descs() == 1)
-			prepare_device(&tst_test->filesystems[0]);
+		if (!tst_test->all_filesystems && count_fs_descs() <= 1) {
+			prepare_device(tst_test->filesystems ?
+				       &tst_test->filesystems[0] :
+				       &(struct tst_fs){.type = tdev.fs_type});
+		}
 	}
 
 	if (tst_test->needs_overlay && !tst_test->mount_device)
-- 
2.45.2


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

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

end of thread, other threads:[~2024-07-09 12:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-09 10:33 [LTP] [PATCH 1/1] tst_test: Fix tests using device without .filesystems Petr Vorel
2024-07-09 11:05 ` Cyril Hrubis
2024-07-09 11:18   ` Petr Vorel
2024-07-09 11:35     ` Cyril Hrubis
2024-07-09 11:56       ` Petr Vorel
2024-07-09 12:44         ` Cyril Hrubis

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