diff mbox series

[1/3] aiocp.c: TCONF on O_DIRECT on tmpfs

Message ID 20230109125234.4232-1-rpalethorpe@suse.com
State Accepted
Headers show
Series [1/3] aiocp.c: TCONF on O_DIRECT on tmpfs | expand

Commit Message

Richard Palethorpe Jan. 9, 2023, 12:52 p.m. UTC
From: Petr Vorel <pvorel@suse.cz>

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

Signed-off-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Richard Palethorpe <rpalethorpe@suse.com>
---
 testcases/kernel/io/ltp-aiodio/aiocp.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/testcases/kernel/io/ltp-aiodio/aiocp.c b/testcases/kernel/io/ltp-aiodio/aiocp.c
index ee893ab11..275000f3e 100644
--- a/testcases/kernel/io/ltp-aiodio/aiocp.c
+++ b/testcases/kernel/io/ltp-aiodio/aiocp.c
@@ -240,6 +240,9 @@  static void setup(void)
 		if (strncmp(str_oflag, "SYNC", 4) == 0) {
 			dstflags |= O_SYNC;
 		} else if (strncmp(str_oflag, "DIRECT", 6) == 0) {
+			if (tst_fs_type(".") == TST_TMPFS_MAGIC)
+				tst_brk(TCONF, "O_DIRECT not supported on tmpfs");
+
 			srcflags |= O_DIRECT;
 			dstflags |= O_DIRECT;
 		}