[Devel] [PATCH RHEL9 COMMIT] fs/fuse kio: check whether the fuse request has been killed
Konstantin Khorenko
khorenko at virtuozzo.com
Thu Jan 23 21:58:17 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.4
------>
commit b7afdb9ff313e147226ad669b7d9ca35816585b3
Author: Liu Kui <kui.liu at virtuozzo.com>
Date: Wed Jan 22 17:44:36 2025 +0800
fs/fuse kio: check whether the fuse request has been killed
When receiving a msg with a kRPC zero-copy buffer, kRPC lookups the
corresponding fuse request to get the actual buffer. However the fuse
request could have been killed and having its buffer released. In
case like this, it is not appropriate to return a fatal error to
userspace, instead we return a positive error value to represent
non-fatal error that pertains to the msg only so that userspace can
adapt accordingly.
Related to #VSTOR-98219
https://virtuozzo.atlassian.net/browse/VSTOR-98219
Signed-off-by: Liu Kui <kui.liu at virtuozzo.com>
Acked-by: Alexey Kuznetsov <kuznet at virtuozzo.com>
Feature: fuse: kRPC - single RPC for kernel and userspace
---
fs/fuse/kio/pcs/pcs_krpc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/fuse/kio/pcs/pcs_krpc.c b/fs/fuse/kio/pcs/pcs_krpc.c
index c549120e3bcb..115bd67aa0d2 100644
--- a/fs/fuse/kio/pcs/pcs_krpc.c
+++ b/fs/fuse/kio/pcs/pcs_krpc.c
@@ -532,8 +532,8 @@ static int pcs_krpc_ioctl_send_msg(struct pcs_krpc *krpc, struct pcs_krpc_ioc_se
chunk->type = KRPC_CHUNK_TYPE_ZC;
chunk->addr = chunk_bdzc->offset;
chunk->req = fuse_dev_find_request(chunk_bdzc->devfd, chunk_bdzc->unique);
- if (!chunk->req) {
- res = -ENXIO;
+ if (!chunk->req || chunk->req->args->killed) {
+ res = PCS_ERR_NET;
goto err_free_data_chunk;
}
break;
More information about the Devel
mailing list