* [LTP] [PATCH v2 1/1] splice07: Whitelist /dev/zero on pipe write
@ 2024-01-26 12:16 Petr Vorel
2024-01-26 13:11 ` Martin Doucha
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Petr Vorel @ 2024-01-26 12:16 UTC (permalink / raw)
To: ltp; +Cc: Jan Kara
/dev/zero on pipe write started to succeeded on kernel 6.7.
This is due commit 1b057bd800c3 ("drivers/char/mem: implement splice()
for /dev/zero, /dev/full") from kernel 6.7.
Suggested-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Changes v1->v2:
* Skip only for kernel >= 6.7
testcases/kernel/syscalls/splice/splice07.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/testcases/kernel/syscalls/splice/splice07.c b/testcases/kernel/syscalls/splice/splice07.c
index 135c42e47..c7b1c9ee5 100644
--- a/testcases/kernel/syscalls/splice/splice07.c
+++ b/testcases/kernel/syscalls/splice/splice07.c
@@ -44,6 +44,10 @@ static void check_splice(struct tst_fd *fd_in, struct tst_fd *fd_out)
/* And this complains about socket not being connected */
case TST_FD_INET_SOCK:
return;
+ /* 1b057bd800c3 implemented splice() for /dev/zero, /dev/full */
+ case TST_FD_DEV_ZERO:
+ if (tst_kvercmp(6, 7, 0) >= 0)
+ return;
default:
break;
}
--
2.43.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH v2 1/1] splice07: Whitelist /dev/zero on pipe write
2024-01-26 12:16 [LTP] [PATCH v2 1/1] splice07: Whitelist /dev/zero on pipe write Petr Vorel
@ 2024-01-26 13:11 ` Martin Doucha
2024-01-26 13:20 ` Petr Vorel
2024-01-26 14:14 ` Cyril Hrubis
2024-01-26 14:13 ` Jan Kara
2024-01-29 10:11 ` Petr Vorel
2 siblings, 2 replies; 9+ messages in thread
From: Martin Doucha @ 2024-01-26 13:11 UTC (permalink / raw)
To: Petr Vorel, ltp; +Cc: Jan Kara
Hi,
splice() works on /dev/zero and /proc/self/maps on older kernels at
least between v4.4 and v5.3.
On 26. 01. 24 13:16, Petr Vorel wrote:
> /dev/zero on pipe write started to succeeded on kernel 6.7.
>
> This is due commit 1b057bd800c3 ("drivers/char/mem: implement splice()
> for /dev/zero, /dev/full") from kernel 6.7.
>
> Suggested-by: Cyril Hrubis <chrubis@suse.cz>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> Changes v1->v2:
> * Skip only for kernel >= 6.7
>
> testcases/kernel/syscalls/splice/splice07.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/testcases/kernel/syscalls/splice/splice07.c b/testcases/kernel/syscalls/splice/splice07.c
> index 135c42e47..c7b1c9ee5 100644
> --- a/testcases/kernel/syscalls/splice/splice07.c
> +++ b/testcases/kernel/syscalls/splice/splice07.c
> @@ -44,6 +44,10 @@ static void check_splice(struct tst_fd *fd_in, struct tst_fd *fd_out)
> /* And this complains about socket not being connected */
> case TST_FD_INET_SOCK:
> return;
> + /* 1b057bd800c3 implemented splice() for /dev/zero, /dev/full */
> + case TST_FD_DEV_ZERO:
> + if (tst_kvercmp(6, 7, 0) >= 0)
> + return;
> default:
> break;
> }
--
Martin Doucha mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH v2 1/1] splice07: Whitelist /dev/zero on pipe write
2024-01-26 13:11 ` Martin Doucha
@ 2024-01-26 13:20 ` Petr Vorel
2024-01-26 14:14 ` Cyril Hrubis
1 sibling, 0 replies; 9+ messages in thread
From: Petr Vorel @ 2024-01-26 13:20 UTC (permalink / raw)
To: Martin Doucha; +Cc: Jan Kara, ltp
> Hi,
> splice() works on /dev/zero and /proc/self/maps on older kernels at least
> between v4.4 and v5.3.
Yep, this was just a sanity fix before the release to fix mainline.
OK, so we should skip also between v4.4 and v5.3?
Because you're testing it, please post better version.
And we should (as Cyril noted) after release add tests which actually test
splice() on /dev/zero and /proc/self/maps.
Thanks!
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH v2 1/1] splice07: Whitelist /dev/zero on pipe write
2024-01-26 12:16 [LTP] [PATCH v2 1/1] splice07: Whitelist /dev/zero on pipe write Petr Vorel
2024-01-26 13:11 ` Martin Doucha
@ 2024-01-26 14:13 ` Jan Kara
2024-01-29 10:11 ` Petr Vorel
2 siblings, 0 replies; 9+ messages in thread
From: Jan Kara @ 2024-01-26 14:13 UTC (permalink / raw)
To: Petr Vorel; +Cc: Jan Kara, ltp
On Fri 26-01-24 13:16:03, Petr Vorel wrote:
> /dev/zero on pipe write started to succeeded on kernel 6.7.
>
> This is due commit 1b057bd800c3 ("drivers/char/mem: implement splice()
> for /dev/zero, /dev/full") from kernel 6.7.
>
> Suggested-by: Cyril Hrubis <chrubis@suse.cz>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
Yeah, makes sense to me. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> Changes v1->v2:
> * Skip only for kernel >= 6.7
>
> testcases/kernel/syscalls/splice/splice07.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/testcases/kernel/syscalls/splice/splice07.c b/testcases/kernel/syscalls/splice/splice07.c
> index 135c42e47..c7b1c9ee5 100644
> --- a/testcases/kernel/syscalls/splice/splice07.c
> +++ b/testcases/kernel/syscalls/splice/splice07.c
> @@ -44,6 +44,10 @@ static void check_splice(struct tst_fd *fd_in, struct tst_fd *fd_out)
> /* And this complains about socket not being connected */
> case TST_FD_INET_SOCK:
> return;
> + /* 1b057bd800c3 implemented splice() for /dev/zero, /dev/full */
> + case TST_FD_DEV_ZERO:
> + if (tst_kvercmp(6, 7, 0) >= 0)
> + return;
> default:
> break;
> }
> --
> 2.43.0
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH v2 1/1] splice07: Whitelist /dev/zero on pipe write
2024-01-26 13:11 ` Martin Doucha
2024-01-26 13:20 ` Petr Vorel
@ 2024-01-26 14:14 ` Cyril Hrubis
2024-01-26 14:19 ` Martin Doucha
1 sibling, 1 reply; 9+ messages in thread
From: Cyril Hrubis @ 2024-01-26 14:14 UTC (permalink / raw)
To: Martin Doucha; +Cc: Jan Kara, ltp
Hi!
> splice() works on /dev/zero and /proc/self/maps on older kernels at
> least between v4.4 and v5.3.
My guess would have been that this stopped working after the changes for
set_fs removal, see:
https://lwn.net/Articles/832121/
and kernel commit 36e2c7421f02
The article explicitly cites that splice() stopped working for files
that does not implemente splice_read().
So splice for these two didn't work between 5.10 and 6.7.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH v2 1/1] splice07: Whitelist /dev/zero on pipe write
2024-01-26 14:14 ` Cyril Hrubis
@ 2024-01-26 14:19 ` Martin Doucha
2024-01-26 14:26 ` Cyril Hrubis
0 siblings, 1 reply; 9+ messages in thread
From: Martin Doucha @ 2024-01-26 14:19 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: Jan Kara, ltp
On 26. 01. 24 15:14, Cyril Hrubis wrote:
> Hi!
>> splice() works on /dev/zero and /proc/self/maps on older kernels at
>> least between v4.4 and v5.3.
>
> My guess would have been that this stopped working after the changes for
> set_fs removal, see:
>
> https://lwn.net/Articles/832121/
>
> and kernel commit 36e2c7421f02
>
> The article explicitly cites that splice() stopped working for files
> that does not implemente splice_read().
>
> So splice for these two didn't work between 5.10 and 6.7.
In that case it makes sense to treat /dev/zero and /proc/self/maps as
unconditionally expected success for splice() to writable pipe.
--
Martin Doucha mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH v2 1/1] splice07: Whitelist /dev/zero on pipe write
2024-01-26 14:19 ` Martin Doucha
@ 2024-01-26 14:26 ` Cyril Hrubis
2024-01-26 14:35 ` Martin Doucha
0 siblings, 1 reply; 9+ messages in thread
From: Cyril Hrubis @ 2024-01-26 14:26 UTC (permalink / raw)
To: Martin Doucha; +Cc: Jan Kara, ltp
Hi!
> In that case it makes sense to treat /dev/zero and /proc/self/maps as
> unconditionally expected success for splice() to writable pipe.
I suppose so. And ideally we should write a separate test just for that
after the release.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH v2 1/1] splice07: Whitelist /dev/zero on pipe write
2024-01-26 14:26 ` Cyril Hrubis
@ 2024-01-26 14:35 ` Martin Doucha
0 siblings, 0 replies; 9+ messages in thread
From: Martin Doucha @ 2024-01-26 14:35 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: Jan Kara, ltp
On 26. 01. 24 15:26, Cyril Hrubis wrote:
> Hi!
>> In that case it makes sense to treat /dev/zero and /proc/self/maps as
>> unconditionally expected success for splice() to writable pipe.
>
> I suppose so. And ideally we should write a separate test just for that
> after the release.
+1 to new test.
--
Martin Doucha mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH v2 1/1] splice07: Whitelist /dev/zero on pipe write
2024-01-26 12:16 [LTP] [PATCH v2 1/1] splice07: Whitelist /dev/zero on pipe write Petr Vorel
2024-01-26 13:11 ` Martin Doucha
2024-01-26 14:13 ` Jan Kara
@ 2024-01-29 10:11 ` Petr Vorel
2 siblings, 0 replies; 9+ messages in thread
From: Petr Vorel @ 2024-01-29 10:11 UTC (permalink / raw)
To: ltp
Hi,
just for a record in the end we decided to merge v1.
https://lore.kernel.org/ltp/20240125155107.430656-1-pvorel@suse.cz/
https://lore.kernel.org/ltp/Zbd44afh7ytamDuA@yuki/
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2024-01-29 10:11 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-26 12:16 [LTP] [PATCH v2 1/1] splice07: Whitelist /dev/zero on pipe write Petr Vorel
2024-01-26 13:11 ` Martin Doucha
2024-01-26 13:20 ` Petr Vorel
2024-01-26 14:14 ` Cyril Hrubis
2024-01-26 14:19 ` Martin Doucha
2024-01-26 14:26 ` Cyril Hrubis
2024-01-26 14:35 ` Martin Doucha
2024-01-26 14:13 ` Jan Kara
2024-01-29 10:11 ` Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox