* [Devel] [PATCH hci-8.1 0/2] fs/fuse kio: two fixes for the sockio transmit refactor
@ 2026-10-01 3:23 Liu Kui
2026-10-01 3:23 ` [Devel] [PATCH hci-8.1 1/2] fs/fuse kio: don't spin on an empty iter in do_sockio_sendmsg() Liu Kui
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Liu Kui @ 2026-10-01 3:23 UTC (permalink / raw)
To: Konstantin Khorenko; +Cc: azaitsev, devel, Liu Kui
Follow-up to the sockio refactor, fixing two issues found in review:
a latent infinite loop on an empty iter in do_sockio_sendmsg(), and
iov_iter_sendpages_ok() missing the last page of a bvec with an
unaligned bv_offset.
https://virtuozzo.atlassian.net/browse/VSTOR-142167
---
Liu Kui (2):
fs/fuse kio: don't spin on an empty iter in do_sockio_sendmsg()
fs/fuse kio: check every touched page in iov_iter_sendpages_ok()
fs/fuse/kio/pcs/pcs_sock_io.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
---
base-commit: 06ad1cd8ca1cd811287ca06c378547202fcca4ee
change-id: 20261001-sockio-sendmsg-empty-iter-405f96a2db01
Best regards,
--
Liu Kui <kui.liu@virtuozzo.com>
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Devel] [PATCH hci-8.1 1/2] fs/fuse kio: don't spin on an empty iter in do_sockio_sendmsg()
2026-10-01 3:23 [Devel] [PATCH hci-8.1 0/2] fs/fuse kio: two fixes for the sockio transmit refactor Liu Kui
@ 2026-10-01 3:23 ` Liu Kui
2026-10-01 3:26 ` no-reply
2026-10-01 3:23 ` [Devel] [PATCH hci-8.1 2/2] fs/fuse kio: check every touched page in iov_iter_sendpages_ok() Liu Kui
2026-10-01 12:05 ` [Devel] [PATCH hci-8.1 0/2] fs/fuse kio: two fixes for the sockio transmit refactor Konstantin Khorenko
2 siblings, 1 reply; 6+ messages in thread
From: Liu Kui @ 2026-10-01 3:23 UTC (permalink / raw)
To: Konstantin Khorenko; +Cc: azaitsev, devel, Liu Kui
If msg->get_iter() ever returns an empty iterator, do_sockio_sendmsg()
spins forever. Restore the old do_send_one_seg() behavior: warn and
fail the msg.
https://virtuozzo.atlassian.net/browse/VSTOR-142167
Fixes: 32b44dc7ba67 ("fs/fuse kio: refactor transmit path in pcs_sockio_send()")
Signed-off-by: Liu Kui <kui.liu@virtuozzo.com>
---
fs/fuse/kio/pcs/pcs_sock_io.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/fs/fuse/kio/pcs/pcs_sock_io.c b/fs/fuse/kio/pcs/pcs_sock_io.c
index 2da6d51c898b..b4a2ceeb331c 100644
--- a/fs/fuse/kio/pcs/pcs_sock_io.c
+++ b/fs/fuse/kio/pcs/pcs_sock_io.c
@@ -307,6 +307,11 @@ static int do_sockio_sendmsg(struct pcs_sockio *sio, struct pcs_msg *msg)
if (!iov_iter_count(it)) {
/* Current iter is exhausted, init new one */
msg->get_iter(msg, sio->write_offset, it, WRITE);
+ /* An empty iter here would spin this loop forever */
+ if (WARN_ON(!iov_iter_count(it))) {
+ clear_and_wake_up_bit(PCS_MSG_BUSY, &msg->flags);
+ return -PCS_ERR_NET_ABORT;
+ }
}
BUG_ON(iov_iter_count(it) > left);
--
Git-155)
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Devel] [PATCH hci-8.1 2/2] fs/fuse kio: check every touched page in iov_iter_sendpages_ok()
2026-10-01 3:23 [Devel] [PATCH hci-8.1 0/2] fs/fuse kio: two fixes for the sockio transmit refactor Liu Kui
2026-10-01 3:23 ` [Devel] [PATCH hci-8.1 1/2] fs/fuse kio: don't spin on an empty iter in do_sockio_sendmsg() Liu Kui
@ 2026-10-01 3:23 ` Liu Kui
2026-10-01 3:26 ` no-reply
2026-10-01 12:05 ` [Devel] [PATCH hci-8.1 0/2] fs/fuse kio: two fixes for the sockio transmit refactor Konstantin Khorenko
2 siblings, 1 reply; 6+ messages in thread
From: Liu Kui @ 2026-10-01 3:23 UTC (permalink / raw)
To: Konstantin Khorenko; +Cc: azaitsev, devel, Liu Kui
A bvec with an unaligned bv_offset can cross into one more page than
sendpages_ok() checks, so fold the intra-page offset into len. Pure
hardening: today the skipped page can never fail sendpage_ok().
https://virtuozzo.atlassian.net/browse/VSTOR-142167
Fixes: 32b44dc7ba67 ("fs/fuse kio: refactor transmit path in pcs_sockio_send()")
Signed-off-by: Liu Kui <kui.liu@virtuozzo.com>
---
fs/fuse/kio/pcs/pcs_sock_io.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/fs/fuse/kio/pcs/pcs_sock_io.c b/fs/fuse/kio/pcs/pcs_sock_io.c
index b4a2ceeb331c..753a85a560bc 100644
--- a/fs/fuse/kio/pcs/pcs_sock_io.c
+++ b/fs/fuse/kio/pcs/pcs_sock_io.c
@@ -272,7 +272,13 @@ static bool iov_iter_sendpages_ok(struct iov_iter *it)
return false;
while (bvec < (it->bvec + it->nr_segs)) {
- if (!sendpages_ok(bvec->bv_page, bvec->bv_len, bvec->bv_offset))
+ /*
+ * Fold the intra-page offset into len so sendpages_ok()
+ * checks every page the range touches.
+ */
+ if (!sendpages_ok(bvec->bv_page,
+ (bvec->bv_offset & ~PAGE_MASK) + bvec->bv_len,
+ bvec->bv_offset & PAGE_MASK))
return false;
bvec++;
}
--
Git-155)
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Devel] [PATCH hci-8.1 2/2] fs/fuse kio: check every touched page in iov_iter_sendpages_ok()
2026-10-01 3:23 ` [Devel] [PATCH hci-8.1 2/2] fs/fuse kio: check every touched page in iov_iter_sendpages_ok() Liu Kui
@ 2026-10-01 3:26 ` no-reply
0 siblings, 0 replies; 6+ messages in thread
From: no-reply @ 2026-10-01 3:26 UTC (permalink / raw)
To: Liu Kui, Konstantin Khorenko; +Cc: devel, azaitsev
> A bvec with an unaligned bv_offset can cross into one more page than
> sendpages_ok() checks, so fold the intra-page offset into len. Pure
> hardening: today the skipped page can never fail sendpage_ok().
>
> https://virtuozzo.atlassian.net/browse/VSTOR-142167
>
> Fixes: 32b44dc7ba67 ("fs/fuse kio: refactor transmit path in pcs_sockio_send()")
> Signed-off-by: Liu Kui <kui.liu@virtuozzo.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261001-sockio-sendmsg-empty-iter-v1-0-b876f4fbb9c7@virtuozzo.com?part=2
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Devel] [PATCH hci-8.1 1/2] fs/fuse kio: don't spin on an empty iter in do_sockio_sendmsg()
2026-10-01 3:23 ` [Devel] [PATCH hci-8.1 1/2] fs/fuse kio: don't spin on an empty iter in do_sockio_sendmsg() Liu Kui
@ 2026-10-01 3:26 ` no-reply
0 siblings, 0 replies; 6+ messages in thread
From: no-reply @ 2026-10-01 3:26 UTC (permalink / raw)
To: Konstantin Khorenko, Liu Kui; +Cc: azaitsev, devel
> If msg->get_iter() ever returns an empty iterator, do_sockio_sendmsg()
> spins forever. Restore the old do_send_one_seg() behavior: warn and
> fail the msg.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-142167
>
> Fixes: 32b44dc7ba67 ("fs/fuse kio: refactor transmit path in pcs_sockio_send()")
> Signed-off-by: Liu Kui <kui.liu@virtuozzo.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261001-sockio-sendmsg-empty-iter-v1-0-b876f4fbb9c7@virtuozzo.com?part=1
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Devel] [PATCH hci-8.1 0/2] fs/fuse kio: two fixes for the sockio transmit refactor
2026-10-01 3:23 [Devel] [PATCH hci-8.1 0/2] fs/fuse kio: two fixes for the sockio transmit refactor Liu Kui
2026-10-01 3:23 ` [Devel] [PATCH hci-8.1 1/2] fs/fuse kio: don't spin on an empty iter in do_sockio_sendmsg() Liu Kui
2026-10-01 3:23 ` [Devel] [PATCH hci-8.1 2/2] fs/fuse kio: check every touched page in iov_iter_sendpages_ok() Liu Kui
@ 2026-10-01 12:05 ` Konstantin Khorenko
2 siblings, 0 replies; 6+ messages in thread
From: Konstantin Khorenko @ 2026-10-01 12:05 UTC (permalink / raw)
To: Liu Kui; +Cc: devel, azaitsev
On Thu, 01 Oct 2026 11:23:40 +0800, Liu Kui wrote:
> fs/fuse kio: two fixes for the sockio transmit refactor
>
> Follow-up to the sockio refactor, fixing two issues found in review:
> a latent infinite loop on an empty iter in do_sockio_sendmsg(), and
> iov_iter_sendpages_ok() missing the last page of a bvec with an
> unaligned bv_offset.
>
> [...]
Applied to branch-rh10-6.12.0-211.52.1.22.x.vz10-ovz, will be released in rh10-6.12.0-211.52.1.22.7.vz10, thanks!
[1/2] fs/fuse kio: don't spin on an empty iter in do_sockio_sendmsg()
https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/668fd929529e
[2/2] fs/fuse kio: check every touched page in iov_iter_sendpages_ok()
https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/0750a95935c5
--
Konstantin Khorenko <khorenko@virtuozzo.com>
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-10-01 12:07 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-01 3:23 [Devel] [PATCH hci-8.1 0/2] fs/fuse kio: two fixes for the sockio transmit refactor Liu Kui
2026-10-01 3:23 ` [Devel] [PATCH hci-8.1 1/2] fs/fuse kio: don't spin on an empty iter in do_sockio_sendmsg() Liu Kui
2026-10-01 3:26 ` no-reply
2026-10-01 3:23 ` [Devel] [PATCH hci-8.1 2/2] fs/fuse kio: check every touched page in iov_iter_sendpages_ok() Liu Kui
2026-10-01 3:26 ` no-reply
2026-10-01 12:05 ` [Devel] [PATCH hci-8.1 0/2] fs/fuse kio: two fixes for the sockio transmit refactor Konstantin Khorenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox