[LTP] [PATCH 1/1] aio-stress: TCONF on O_DIRECT on tmpfs

Petr Vorel pvorel@suse.cz
Fri Dec 16 12:43:31 CET 2022


O_DIRECT is not supported on tmpfs. This flag is added by -O option,
thus cannot be filtered with .skip_filesystems.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/io/ltp-aiodio/aio-stress.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/io/ltp-aiodio/aio-stress.c b/testcases/kernel/io/ltp-aiodio/aio-stress.c
index 39db14d651..f20383dcfc 100644
--- a/testcases/kernel/io/ltp-aiodio/aio-stress.c
+++ b/testcases/kernel/io/ltp-aiodio/aio-stress.c
@@ -1239,10 +1239,13 @@ static void setup(void)
 	if (tst_parse_int(str_num_threads, &num_threads, 1, INT_MAX))
 		tst_brk(TBROK, "Invalid number of threads '%s'", str_num_threads);
 
-	if (str_o_flag)
+	if (str_o_flag) {
+		if (tst_fs_type(".") == TST_TMPFS_MAGIC)
+			tst_brk(TCONF, "O_DIRECT not supported on tmpfs");
 		o_flag = O_DIRECT;
-	else
+	} else {
 		o_flag = O_SYNC;
+	}
 
 	if (str_use_shm) {
 		if (!strcmp(str_use_shm, "shm")) {
-- 
2.39.0



More information about the ltp mailing list