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

Richard Palethorpe rpalethorpe@suse.com
Mon Jan 9 13:52:34 CET 2023


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 --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");
-- 
2.39.0



More information about the ltp mailing list