* Re: [LTP] [PATCH v2 3/7] Add ioctl_ficlone02 test
[not found] ` <20240723-ioctl_ficlone-v2-3-33075bbc117f@suse.com>
@ 2024-07-29 11:53 ` Petr Vorel
2024-07-29 12:03 ` Cyril Hrubis
0 siblings, 1 reply; 3+ messages in thread
From: Petr Vorel @ 2024-07-29 11:53 UTC (permalink / raw)
To: Andrea Cervesato; +Cc: ltp, linux-bcachefs, Kent Overstreet, Cyril Hrubis
Hi all,
> This test verifies that ioctl() FICLONE/FICLONERANGE feature
> correctly raises EOPNOTSUPP when unsupported filesystem is used.
> In particular, filesystems which don't support copy-on-write.
This test, merged as [1] fails on bcachefs:
$ cd testcases/kernel/syscalls/ioctl/
# # LTP_SINGLE_FS_TYPE=bcachefs ./ioctl_ficlone02
tst_buffers.c:57: TINFO: Test is using guarded buffers
tst_tmpdir.c:316: TINFO: Using /tmp/LTP_iocu1xhKp as tmpdir (tmpfs filesystem)
tst_device.c:96: TINFO: Found free device 0 '/dev/loop0'
tst_test.c:1806: TINFO: LTP version: 20240524-131-gdfb293ee0
tst_test.c:1650: TINFO: Timeout per run is 0h 00m 30s
tst_supported_fs_types.c:161: TINFO: WARNING: testing only bcachefs
tst_supported_fs_types.c:97: TINFO: Kernel supports bcachefs
tst_supported_fs_types.c:62: TINFO: mkfs.bcachefs does exist
tst_test.c:1746: TINFO: === Testing on bcachefs ===
tst_test.c:1111: TINFO: Formatting /dev/loop0 with bcachefs opts='' extra opts=''
tst_test.c:1123: TINFO: Mounting /dev/loop0 to /tmp/LTP_iocu1xhKp/mnt fstyp=bcachefs flags=0
ioctl_ficlone02.c:33: TFAIL: ioctl(dst_fd, FICLONE, src_fd) succeeded
ioctl_ficlone02.c:34: TFAIL: ioctl(dst_fd, FICLONERANGE, clone_range) expected EOPNOTSUPP: EINVAL (22)
I tested only kernel 6.10 and 6.9, fails on both. Maybe it's just a different
errno set...
Kind regards,
Petr
[1] https://github.com/linux-test-project/ltp/commit/d70bfb185c9aa52aeab9b9893055eec7fc969a4f
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH v2 3/7] Add ioctl_ficlone02 test
2024-07-29 11:53 ` [LTP] [PATCH v2 3/7] Add ioctl_ficlone02 test Petr Vorel
@ 2024-07-29 12:03 ` Cyril Hrubis
2024-07-29 21:29 ` Petr Vorel
0 siblings, 1 reply; 3+ messages in thread
From: Cyril Hrubis @ 2024-07-29 12:03 UTC (permalink / raw)
To: Petr Vorel; +Cc: Andrea Cervesato, ltp, linux-bcachefs, Kent Overstreet
Hi!
> This test, merged as [1] fails on bcachefs:
>
> $ cd testcases/kernel/syscalls/ioctl/
> # # LTP_SINGLE_FS_TYPE=bcachefs ./ioctl_ficlone02
> tst_buffers.c:57: TINFO: Test is using guarded buffers
> tst_tmpdir.c:316: TINFO: Using /tmp/LTP_iocu1xhKp as tmpdir (tmpfs filesystem)
> tst_device.c:96: TINFO: Found free device 0 '/dev/loop0'
> tst_test.c:1806: TINFO: LTP version: 20240524-131-gdfb293ee0
> tst_test.c:1650: TINFO: Timeout per run is 0h 00m 30s
> tst_supported_fs_types.c:161: TINFO: WARNING: testing only bcachefs
> tst_supported_fs_types.c:97: TINFO: Kernel supports bcachefs
> tst_supported_fs_types.c:62: TINFO: mkfs.bcachefs does exist
> tst_test.c:1746: TINFO: === Testing on bcachefs ===
> tst_test.c:1111: TINFO: Formatting /dev/loop0 with bcachefs opts='' extra opts=''
> tst_test.c:1123: TINFO: Mounting /dev/loop0 to /tmp/LTP_iocu1xhKp/mnt fstyp=bcachefs flags=0
> ioctl_ficlone02.c:33: TFAIL: ioctl(dst_fd, FICLONE, src_fd) succeeded
> ioctl_ficlone02.c:34: TFAIL: ioctl(dst_fd, FICLONERANGE, clone_range) expected EOPNOTSUPP: EINVAL (22)
This looks that FIOCLONE is supported on bcachefs and bcachefs should be
skipped in this test as well. And I suppose that we should enable
bcachefs in the rest of the FICLONE tests too.
BTW, the EINVAL in the second subtest is caused by the fact that we
attempt to clone a range that does not exist, this can be fixed by:
diff --git a/testcases/kernel/syscalls/ioctl/ioctl_ficlone02.c b/testcases/kernel/syscalls/ioctl/ioctl_ficlone02.c
index be3b01c29..17452a1a3 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl_ficlone02.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl_ficlone02.c
@@ -43,6 +43,8 @@ static void setup(void)
SAFE_STAT(MNTPOINT, &sb);
+ tst_fill_file(SRCPATH, 0x00, sb.st_blksize, 1);
+
clone_range->src_offset = 0;
clone_range->src_length = sb.st_blksize;
clone_range->dest_offset = 0;
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH v2 3/7] Add ioctl_ficlone02 test
2024-07-29 12:03 ` Cyril Hrubis
@ 2024-07-29 21:29 ` Petr Vorel
0 siblings, 0 replies; 3+ messages in thread
From: Petr Vorel @ 2024-07-29 21:29 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: Andrea Cervesato, ltp, linux-bcachefs, Kent Overstreet
Hi Cyril, all,
> Hi!
> > This test, merged as [1] fails on bcachefs:
> > $ cd testcases/kernel/syscalls/ioctl/
> > # # LTP_SINGLE_FS_TYPE=bcachefs ./ioctl_ficlone02
> > tst_buffers.c:57: TINFO: Test is using guarded buffers
> > tst_tmpdir.c:316: TINFO: Using /tmp/LTP_iocu1xhKp as tmpdir (tmpfs filesystem)
> > tst_device.c:96: TINFO: Found free device 0 '/dev/loop0'
> > tst_test.c:1806: TINFO: LTP version: 20240524-131-gdfb293ee0
> > tst_test.c:1650: TINFO: Timeout per run is 0h 00m 30s
> > tst_supported_fs_types.c:161: TINFO: WARNING: testing only bcachefs
> > tst_supported_fs_types.c:97: TINFO: Kernel supports bcachefs
> > tst_supported_fs_types.c:62: TINFO: mkfs.bcachefs does exist
> > tst_test.c:1746: TINFO: === Testing on bcachefs ===
> > tst_test.c:1111: TINFO: Formatting /dev/loop0 with bcachefs opts='' extra opts=''
> > tst_test.c:1123: TINFO: Mounting /dev/loop0 to /tmp/LTP_iocu1xhKp/mnt fstyp=bcachefs flags=0
> > ioctl_ficlone02.c:33: TFAIL: ioctl(dst_fd, FICLONE, src_fd) succeeded
> > ioctl_ficlone02.c:34: TFAIL: ioctl(dst_fd, FICLONERANGE, clone_range) expected EOPNOTSUPP: EINVAL (22)
> This looks that FIOCLONE is supported on bcachefs and bcachefs should be
> skipped in this test as well. And I suppose that we should enable
> bcachefs in the rest of the FICLONE tests too.
Thanks! (I should have read the test description).
I dared to enable it + skip on ioctl_ficlone02.c and merge with your SBT
https://github.com/linux-test-project/ltp/commit/b3d9561793657239548269378d02f65580917e7c
> BTW, the EINVAL in the second subtest is caused by the fact that we
> attempt to clone a range that does not exist, this can be fixed by:
> diff --git a/testcases/kernel/syscalls/ioctl/ioctl_ficlone02.c b/testcases/kernel/syscalls/ioctl/ioctl_ficlone02.c
> index be3b01c29..17452a1a3 100644
> --- a/testcases/kernel/syscalls/ioctl/ioctl_ficlone02.c
> +++ b/testcases/kernel/syscalls/ioctl/ioctl_ficlone02.c
> @@ -43,6 +43,8 @@ static void setup(void)
> SAFE_STAT(MNTPOINT, &sb);
> + tst_fill_file(SRCPATH, 0x00, sb.st_blksize, 1);
> +
> clone_range->src_offset = 0;
> clone_range->src_length = sb.st_blksize;
> clone_range->dest_offset = 0;
Thanks, again! This is less confusing. I again dared to merge with your SBT:
https://github.com/linux-test-project/ltp/commit/9c6390812831f5c36e531be5a25bd8d7862e79fb
Kind regards,
Petr
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-07-29 21:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20240723-ioctl_ficlone-v2-0-33075bbc117f@suse.com>
[not found] ` <20240723-ioctl_ficlone-v2-3-33075bbc117f@suse.com>
2024-07-29 11:53 ` [LTP] [PATCH v2 3/7] Add ioctl_ficlone02 test Petr Vorel
2024-07-29 12:03 ` Cyril Hrubis
2024-07-29 21:29 ` Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox