[Devel] [PATCH RHEL9 COMMIT] fs/fuse/kio: correct return of error from io backed to rpc
Konstantin Khorenko
khorenko at virtuozzo.com
Fri Mar 28 23:50:58 MSK 2025
The commit is pushed to "branch-rh9-5.14.0-427.44.1.vz9.80.x-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh9-5.14.0-427.44.1.vz9.80.23
------>
commit 1ac58e6cf72f21a007c1032d73e7ce7659836426
Author: Alexey Kuznetsov <kuznet at virtuozzo.com>
Date: Fri Mar 28 20:00:42 2025 +0800
fs/fuse/kio: correct return of error from io backed to rpc
Backport from user space. The bug is unlikely to see in kernel
and we have never observe it. Yet, it is better to keep this place clean.
Cloning comment from corresponsing user space commit:
We used to have an ugly problem there, when ->done is called from
IO backend which is not aware about rpc logic it considered all
the errors as local. The damage at least on client->cs rpc users
is severe, local errors are considered not inflicted by failing cluster
neighbors, but blamed on local host, so that cluster recovery process
is not triggered. It exposed itself big time on KRPC (in user space),
but it can be dangerous for plain sock/rdma backends too.
The bug is ancient, it was present since day zero, but we never noticed it,
because error of this kind are very rare with TCP: write is non-blocking
as rule, we must have filled sndbuf when the socket aborts and to lose
error we should not have any uncompleted rpc requests, as error for them
will trigger correct path. Not easy to see the bug, yet possible.
Let's not overthink this, it is enough to fix the issue in client-cs path,
which can be done with special kludge in cs_sent.
NOTE: special ugly exception for PCS_ERR_NOMEM is inherited from older
pcs_set_rpc_error which in fact serves the same function in rpc context.
Affects: #VSTOR-100586
https://virtuozzo.atlassian.net/browse/VSTOR-100586
Signed-off-by: Alexey Kuznetsov <kuznet at virtuozzo.com>
Feature: vStorage
---
fs/fuse/kio/pcs/pcs_cs.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/fuse/kio/pcs/pcs_cs.c b/fs/fuse/kio/pcs/pcs_cs.c
index 07075759a658..ad398acb03ef 100644
--- a/fs/fuse/kio/pcs/pcs_cs.c
+++ b/fs/fuse/kio/pcs/pcs_cs.c
@@ -551,6 +551,10 @@ static void cs_sent(struct pcs_msg *msg)
{
msg->done = cs_response_done;
if (pcs_if_error(&msg->error)) {
+ if (msg->rpc && !msg->error.remote && msg->error.value != PCS_ERR_NOMEM) {
+ msg->error.remote = 1;
+ msg->error.offender = msg->rpc->peer_id;
+ }
msg->done(msg);
return;
}
More information about the Devel
mailing list