[Devel] [PATCH VZ9 3/3] fs/fuse kio: check whether the fuse request has been killed
Liu Kui
kui.liu at virtuozzo.com
Tue Jan 21 11:32:17 MSK 2025
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
Signed-off-by: Liu Kui <kui.liu at virtuozzo.com>
---
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 b7509069fb11..4f68e8706334 100644
--- a/fs/fuse/kio/pcs/pcs_krpc.c
+++ b/fs/fuse/kio/pcs/pcs_krpc.c
@@ -484,8 +484,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;
--
2.39.5 (Apple Git-154)
More information about the Devel
mailing list