Skip to contentSkip to conversation

aio-stress: TCONF on O_DIRECT on tmpfs

PATCH In review Petr Vorel 2 participants 4 messages Dec 16, 2022 – Jan 11, 2023

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 aio-stress: TCONF on O_DIRECT on tmpfs

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

---
 testcases/kernel/io/ltp-aiodio/aio-stress.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
testcases/kernel/io/ltp-aiodio/aio-stress.c +5 -2
index 39db14d651..f20383dcfc 100644
@@ -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")) {
Signature · 5 lines
2.39.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#1 lore raw

Hi Andrea,

Quoted 2 lines

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

NOTE: it fixes
aio-stress.c:1339: TBROK: open(file0.bin,16450,0600) failed: EINVAL (22)

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw

Hello,

Quoted 10 lines · Petr Vorel

Hi Andrea,

Quoted 2 lines

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

NOTE: it fixes
aio-stress.c:1339: TBROK: open(file0.bin,16450,0600) failed: EINVAL (22)

Kind regards,
Petr

I merged this, although I don't think it is quite correct to say tmpfs doesn't support O_DIRECT. It's more like it is in O_DIRECT mode by default. Either way though we don't need to run the test with O_DIRECT and without it.

Signature · 5 lines
Thank you,
Richard.

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#3 lore raw

Hi Richie,

Quoted 4 lines

I merged this, although I don't think it is quite correct to say tmpfs doesn't support O_DIRECT. It's more like it is in O_DIRECT mode by default. Either way though we don't need to run the test with O_DIRECT and without it.

NOTE: feel free to correct me (amend the message) before merge.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp