[Devel] [PATCH hci-8.1 1/2] fs/fuse kio: don't spin on an empty iter in do_sockio_sendmsg()
Liu Kui
kui.liu at virtuozzo.com
Thu Oct 1 06:23:41 MSK 2026
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 at 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)
More information about the Devel
mailing list