* [LTP] [PATCH 1/1] aiocp.c: TCONF on O_DIRECT on tmpfs
@ 2022-12-16 11:50 Petr Vorel
2022-12-16 13:08 ` Petr Vorel
0 siblings, 1 reply; 7+ messages in thread
From: Petr Vorel @ 2022-12-16 11:50 UTC (permalink / raw)
To: ltp
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>
---
testcases/kernel/io/ltp-aiodio/aiocp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/testcases/kernel/io/ltp-aiodio/aiocp.c b/testcases/kernel/io/ltp-aiodio/aiocp.c
index ee893ab118..275000f3e8 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;
}
--
2.39.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [LTP] [PATCH 1/1] aiocp.c: TCONF on O_DIRECT on tmpfs
2022-12-16 11:50 [LTP] [PATCH 1/1] aiocp.c: TCONF on O_DIRECT on tmpfs Petr Vorel
@ 2022-12-16 13:08 ` Petr Vorel
2022-12-16 13:13 ` Petr Vorel
2022-12-20 13:19 ` Richard Palethorpe
0 siblings, 2 replies; 7+ messages in thread
From: Petr Vorel @ 2022-12-16 13:08 UTC (permalink / raw)
To: ltp
Hi,
hm, it looks like it requires to skip tmpfs, as all tests TCONF:
aiocp.c:231: TINFO: Maximum AIO blocks: 65536
tst_device.c:541: TINFO: Use BTRFS specific strategy
tst_device.c:559: TBROK: BTRFS ioctl failed. Is . on a tmpfs?: ENOTTY (25)
I check if it'd work without
e1b1ae66b2 ("tst_find_backing_dev: Get dev name from /sys/dev/block/*/uevent")
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [LTP] [PATCH 1/1] aiocp.c: TCONF on O_DIRECT on tmpfs
2022-12-16 13:08 ` Petr Vorel
@ 2022-12-16 13:13 ` Petr Vorel
2022-12-19 12:07 ` Cyril Hrubis
2022-12-20 13:19 ` Richard Palethorpe
1 sibling, 1 reply; 7+ messages in thread
From: Petr Vorel @ 2022-12-16 13:13 UTC (permalink / raw)
To: ltp, Andrea Cervesato
> hm, it looks like it requires to skip tmpfs, as all tests TCONF:
> aiocp.c:231: TINFO: Maximum AIO blocks: 65536
> tst_device.c:541: TINFO: Use BTRFS specific strategy
> tst_device.c:559: TBROK: BTRFS ioctl failed. Is . on a tmpfs?: ENOTTY (25)
> I check if it'd work without
> e1b1ae66b2 ("tst_find_backing_dev: Get dev name from /sys/dev/block/*/uevent")
TMPDIR=/home/foo ./aiocp -b 1k -n 1 -f DIRECT # xfs
tst_test.c:1558: TINFO: Timeout per run is 0h 30m 30s
tst_test.c:1310: TINFO: xfs is supported by the test
aiocp.c:231: TINFO: Maximum AIO blocks: 65536
tst_device.c:585: TINFO: Use uevent strategy
aiocp.c:267: TINFO: Fill srcfile.bin with random data
aiocp.c:84: TBROK: write(3,0x7ffeccb9da00,60274) failed: EINVAL (22)
TMPDIR=/var/tmp ./aiocp -b 1k -n 1 -f DIRECT # ext4
tst_test.c:1558: TINFO: Timeout per run is 0h 30m 30s
tst_test.c:1310: TINFO: ext2/ext3/ext4 is supported by the test
aiocp.c:231: TINFO: Maximum AIO blocks: 65536
tst_device.c:585: TINFO: Use uevent strategy
aiocp.c:267: TINFO: Fill srcfile.bin with random data
aiocp.c:84: TBROK: write(3,0x7ffda9e14120,50530) failed: EINVAL (22)
uname -r
6.1.0-rc8-2.g2fb1790-default
=> even more things to investigate.
Kind regards,
Petr
> Kind regards,
> Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [LTP] [PATCH 1/1] aiocp.c: TCONF on O_DIRECT on tmpfs
2022-12-16 13:13 ` Petr Vorel
@ 2022-12-19 12:07 ` Cyril Hrubis
2022-12-23 18:26 ` Petr Vorel
0 siblings, 1 reply; 7+ messages in thread
From: Cyril Hrubis @ 2022-12-19 12:07 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
Hi!
> > hm, it looks like it requires to skip tmpfs, as all tests TCONF:
> > aiocp.c:231: TINFO: Maximum AIO blocks: 65536
> > tst_device.c:541: TINFO: Use BTRFS specific strategy
> > tst_device.c:559: TBROK: BTRFS ioctl failed. Is . on a tmpfs?: ENOTTY (25)
>
> > I check if it'd work without
> > e1b1ae66b2 ("tst_find_backing_dev: Get dev name from /sys/dev/block/*/uevent")
>
> TMPDIR=/home/foo ./aiocp -b 1k -n 1 -f DIRECT # xfs
> tst_test.c:1558: TINFO: Timeout per run is 0h 30m 30s
> tst_test.c:1310: TINFO: xfs is supported by the test
> aiocp.c:231: TINFO: Maximum AIO blocks: 65536
> tst_device.c:585: TINFO: Use uevent strategy
> aiocp.c:267: TINFO: Fill srcfile.bin with random data
> aiocp.c:84: TBROK: write(3,0x7ffeccb9da00,60274) failed: EINVAL (22)
>
> TMPDIR=/var/tmp ./aiocp -b 1k -n 1 -f DIRECT # ext4
> tst_test.c:1558: TINFO: Timeout per run is 0h 30m 30s
> tst_test.c:1310: TINFO: ext2/ext3/ext4 is supported by the test
> aiocp.c:231: TINFO: Maximum AIO blocks: 65536
> tst_device.c:585: TINFO: Use uevent strategy
> aiocp.c:267: TINFO: Fill srcfile.bin with random data
> aiocp.c:84: TBROK: write(3,0x7ffda9e14120,50530) failed: EINVAL (22)
Ah, I suppose that this fails because we are wrongly passing the
srcflags to the open() that fills the source file with random data and
we end up passing O_DIRECT to the function that does not aling the
buffers and sizes at all.
Does this fix it?
diff --git a/testcases/kernel/io/ltp-aiodio/aiocp.c b/testcases/kernel/io/ltp-aiodio/aiocp.c
index ee893ab11..a75da6a0c 100644
--- a/testcases/kernel/io/ltp-aiodio/aiocp.c
+++ b/testcases/kernel/io/ltp-aiodio/aiocp.c
@@ -263,7 +263,7 @@ static void setup(void)
tst_res(TINFO, "Fill %s with random data", srcname);
- srcfd = SAFE_OPEN(srcname, srcflags | O_RDWR | O_CREAT, 0666);
+ srcfd = SAFE_OPEN(srcname, O_WRONLY | O_CREAT, 0666);
fill_with_rand_data(srcfd, filesize);
SAFE_CLOSE(srcfd);
}
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [LTP] [PATCH 1/1] aiocp.c: TCONF on O_DIRECT on tmpfs
2022-12-16 13:08 ` Petr Vorel
2022-12-16 13:13 ` Petr Vorel
@ 2022-12-20 13:19 ` Richard Palethorpe
1 sibling, 0 replies; 7+ messages in thread
From: Richard Palethorpe @ 2022-12-20 13:19 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
Hello,
Petr Vorel <pvorel@suse.cz> writes:
> Hi,
>
> hm, it looks like it requires to skip tmpfs, as all tests TCONF:
> aiocp.c:231: TINFO: Maximum AIO blocks: 65536
> tst_device.c:541: TINFO: Use BTRFS specific strategy
> tst_device.c:559: TBROK: BTRFS ioctl failed. Is . on a tmpfs?: ENOTTY (25)
>
> I check if it'd work without
> e1b1ae66b2 ("tst_find_backing_dev: Get dev name from /sys/dev/block/*/uevent")
>
> Kind regards,
> Petr
tmpfs is not backed by a block device so there is no block size. Unless
we treat the page size as the block size. So possibly tst_dev_block_size
should return the page size.
--
Thank you,
Richard.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [LTP] [PATCH 1/1] aiocp.c: TCONF on O_DIRECT on tmpfs
2022-12-19 12:07 ` Cyril Hrubis
@ 2022-12-23 18:26 ` Petr Vorel
2023-01-09 11:19 ` Richard Palethorpe
0 siblings, 1 reply; 7+ messages in thread
From: Petr Vorel @ 2022-12-23 18:26 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: Richard Palethorpe, ltp
> Hi!
> > > hm, it looks like it requires to skip tmpfs, as all tests TCONF:
> > > aiocp.c:231: TINFO: Maximum AIO blocks: 65536
> > > tst_device.c:541: TINFO: Use BTRFS specific strategy
> > > tst_device.c:559: TBROK: BTRFS ioctl failed. Is . on a tmpfs?: ENOTTY (25)
> > > I check if it'd work without
> > > e1b1ae66b2 ("tst_find_backing_dev: Get dev name from /sys/dev/block/*/uevent")
> > TMPDIR=/home/foo ./aiocp -b 1k -n 1 -f DIRECT # xfs
> > tst_test.c:1558: TINFO: Timeout per run is 0h 30m 30s
> > tst_test.c:1310: TINFO: xfs is supported by the test
> > aiocp.c:231: TINFO: Maximum AIO blocks: 65536
> > tst_device.c:585: TINFO: Use uevent strategy
> > aiocp.c:267: TINFO: Fill srcfile.bin with random data
> > aiocp.c:84: TBROK: write(3,0x7ffeccb9da00,60274) failed: EINVAL (22)
> > TMPDIR=/var/tmp ./aiocp -b 1k -n 1 -f DIRECT # ext4
> > tst_test.c:1558: TINFO: Timeout per run is 0h 30m 30s
> > tst_test.c:1310: TINFO: ext2/ext3/ext4 is supported by the test
> > aiocp.c:231: TINFO: Maximum AIO blocks: 65536
> > tst_device.c:585: TINFO: Use uevent strategy
> > aiocp.c:267: TINFO: Fill srcfile.bin with random data
> > aiocp.c:84: TBROK: write(3,0x7ffda9e14120,50530) failed: EINVAL (22)
> Ah, I suppose that this fails because we are wrongly passing the
> srcflags to the open() that fills the source file with random data and
> we end up passing O_DIRECT to the function that does not aling the
> buffers and sizes at all.
> Does this fix it?
Hi Cyril,
unfortunately the output is the same on all 3 tested filesystems.
Any other hint what could fix it?
Kind regards,
Petr
> diff --git a/testcases/kernel/io/ltp-aiodio/aiocp.c b/testcases/kernel/io/ltp-aiodio/aiocp.c
> index ee893ab11..a75da6a0c 100644
> --- a/testcases/kernel/io/ltp-aiodio/aiocp.c
> +++ b/testcases/kernel/io/ltp-aiodio/aiocp.c
> @@ -263,7 +263,7 @@ static void setup(void)
> tst_res(TINFO, "Fill %s with random data", srcname);
> - srcfd = SAFE_OPEN(srcname, srcflags | O_RDWR | O_CREAT, 0666);
> + srcfd = SAFE_OPEN(srcname, O_WRONLY | O_CREAT, 0666);
> fill_with_rand_data(srcfd, filesize);
> SAFE_CLOSE(srcfd);
> }
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [LTP] [PATCH 1/1] aiocp.c: TCONF on O_DIRECT on tmpfs
2022-12-23 18:26 ` Petr Vorel
@ 2023-01-09 11:19 ` Richard Palethorpe
0 siblings, 0 replies; 7+ messages in thread
From: Richard Palethorpe @ 2023-01-09 11:19 UTC (permalink / raw)
To: Petr Vorel; +Cc: Andrea Cervesato, ltp
Hello,
Petr Vorel <pvorel@suse.cz> writes:
>> Hi!
>> > > hm, it looks like it requires to skip tmpfs, as all tests TCONF:
>> > > aiocp.c:231: TINFO: Maximum AIO blocks: 65536
>> > > tst_device.c:541: TINFO: Use BTRFS specific strategy
>> > > tst_device.c:559: TBROK: BTRFS ioctl failed. Is . on a tmpfs?: ENOTTY (25)
>
>> > > I check if it'd work without
>> > > e1b1ae66b2 ("tst_find_backing_dev: Get dev name from /sys/dev/block/*/uevent")
>
>> > TMPDIR=/home/foo ./aiocp -b 1k -n 1 -f DIRECT # xfs
>> > tst_test.c:1558: TINFO: Timeout per run is 0h 30m 30s
>> > tst_test.c:1310: TINFO: xfs is supported by the test
>> > aiocp.c:231: TINFO: Maximum AIO blocks: 65536
>> > tst_device.c:585: TINFO: Use uevent strategy
>> > aiocp.c:267: TINFO: Fill srcfile.bin with random data
>> > aiocp.c:84: TBROK: write(3,0x7ffeccb9da00,60274) failed: EINVAL (22)
>
>> > TMPDIR=/var/tmp ./aiocp -b 1k -n 1 -f DIRECT # ext4
>> > tst_test.c:1558: TINFO: Timeout per run is 0h 30m 30s
>> > tst_test.c:1310: TINFO: ext2/ext3/ext4 is supported by the test
>> > aiocp.c:231: TINFO: Maximum AIO blocks: 65536
>> > tst_device.c:585: TINFO: Use uevent strategy
>> > aiocp.c:267: TINFO: Fill srcfile.bin with random data
>> > aiocp.c:84: TBROK: write(3,0x7ffda9e14120,50530) failed: EINVAL (22)
>
>> Ah, I suppose that this fails because we are wrongly passing the
>> srcflags to the open() that fills the source file with random data and
>> we end up passing O_DIRECT to the function that does not aling the
>> buffers and sizes at all.
>
>> Does this fix it?
>
> Hi Cyril,
>
> unfortunately the output is the same on all 3 tested filesystems.
> Any other hint what could fix it?
>
EINVAL fd is attached to an object which is unsuitable for writing; or
the file was opened with the O_DIRECT flag, and either the ad-
dress specified in buf, the value specified in count, or the
file offset is not suitably aligned.
I suppose that writes should be aligned to the block size. Which
according to the lengths written they are not. There's also no reason to
open srcfd with O_DIRECT AFAICT?
We could also change fill_with_rand_data to use tst_rand_data. I'll post
a patch
>
> Kind regards,
> Petr
>
>> diff --git a/testcases/kernel/io/ltp-aiodio/aiocp.c b/testcases/kernel/io/ltp-aiodio/aiocp.c
>> index ee893ab11..a75da6a0c 100644
>> --- a/testcases/kernel/io/ltp-aiodio/aiocp.c
>> +++ b/testcases/kernel/io/ltp-aiodio/aiocp.c
>> @@ -263,7 +263,7 @@ static void setup(void)
>
>> tst_res(TINFO, "Fill %s with random data", srcname);
>
>> - srcfd = SAFE_OPEN(srcname, srcflags | O_RDWR | O_CREAT, 0666);
>> + srcfd = SAFE_OPEN(srcname, O_WRONLY | O_CREAT, 0666);
>> fill_with_rand_data(srcfd, filesize);
>> SAFE_CLOSE(srcfd);
>> }
--
Thank you,
Richard.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-01-09 11:34 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-16 11:50 [LTP] [PATCH 1/1] aiocp.c: TCONF on O_DIRECT on tmpfs Petr Vorel
2022-12-16 13:08 ` Petr Vorel
2022-12-16 13:13 ` Petr Vorel
2022-12-19 12:07 ` Cyril Hrubis
2022-12-23 18:26 ` Petr Vorel
2023-01-09 11:19 ` Richard Palethorpe
2022-12-20 13:19 ` Richard Palethorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox