diff mbox series

[3/3] aiocp: Don't try to get tmpfs blocksize

Message ID 20230109125234.4232-3-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
TMPFS is backed by RAM and RAM is partitioned into "pages" not
"blocks". I don't know if TMPFS has a block size defined somewhere and
if this is accessible. Regardless it makes no sense to get it's
backing block device properties.

Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
---
 testcases/kernel/io/ltp-aiodio/aiocp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/testcases/kernel/io/ltp-aiodio/aiocp.c b/testcases/kernel/io/ltp-aiodio/aiocp.c
index cace924a2..bc0e209b2 100644
--- a/testcases/kernel/io/ltp-aiodio/aiocp.c
+++ b/testcases/kernel/io/ltp-aiodio/aiocp.c
@@ -228,7 +228,10 @@  static void setup(void)
 		}
 	}
 
-	alignment = tst_dev_block_size(".");
+	if (tst_fs_type(".") == TST_TMPFS_MAGIC)
+		alignment = getpagesize();
+	else
+		alignment = tst_dev_block_size(".");
 
 	if (dstflags & O_DIRECT && aio_blksize % alignment)
 		tst_brk(TCONF, "Block size is not multiple of drive block size");