[Devel] [PATCH RHEL9 COMMIT] fs/fuse kio: fixed a bug in pcs_rpc_cancel_msg()
Konstantin Khorenko
khorenko at virtuozzo.com
Thu Nov 21 19:16:32 MSK 2024
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.1
------>
commit 1d838075e07bd0601ec89ce9ed5ff436e62c45fc
Author: Liu Kui <kui.liu at virtuozzo.com>
Date: Thu Nov 21 10:44:31 2024 +0800
fs/fuse kio: fixed a bug in pcs_rpc_cancel_msg()
Pass the pointer of pcs_rpc instance from caller because msg->rpc
could be NULL when the msg is still in the input_queue.
Signed-off-by: Liu Kui <kui.liu at virtuozzo.com>
Feature: fuse: kRPC - single RPC for kernel and userspace
---
fs/fuse/kio/pcs/pcs_krpc.c | 4 ++--
fs/fuse/kio/pcs/pcs_rpc.c | 5 +----
fs/fuse/kio/pcs/pcs_rpc.h | 2 +-
3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/fs/fuse/kio/pcs/pcs_krpc.c b/fs/fuse/kio/pcs/pcs_krpc.c
index 68a30d7c3e2d..9af1c93b20ed 100644
--- a/fs/fuse/kio/pcs/pcs_krpc.c
+++ b/fs/fuse/kio/pcs/pcs_krpc.c
@@ -567,7 +567,7 @@ static int pcs_krpc_abort(struct pcs_krpc *krpc)
kreq->flags |= KRPC_REQ_F_ABORTED;
msg = &kreq->msg;
/* if msg is cancelled, kreq will be removed from the queue */
- pcs_rpc_cancel_msg(msg);
+ pcs_rpc_cancel_msg(ep, msg);
}
/*
@@ -583,7 +583,7 @@ static int pcs_krpc_abort(struct pcs_krpc *krpc)
msg = &kreq->msg;
/* no longer busy and cancelled */
- if (!pcs_rpc_cancel_msg(msg))
+ if (!pcs_rpc_cancel_msg(ep, msg))
continue;
/* seems somthing wrong happened to hardware, abort the rpc */
diff --git a/fs/fuse/kio/pcs/pcs_rpc.c b/fs/fuse/kio/pcs/pcs_rpc.c
index 79254431592a..9d782b6bea93 100644
--- a/fs/fuse/kio/pcs/pcs_rpc.c
+++ b/fs/fuse/kio/pcs/pcs_rpc.c
@@ -578,11 +578,8 @@ void pcs_rpc_cancel_request(struct pcs_msg * msg)
msg->done(msg);
}
-int pcs_rpc_cancel_msg(struct pcs_msg *msg)
+int pcs_rpc_cancel_msg(struct pcs_rpc *ep, struct pcs_msg *msg)
{
- struct pcs_rpc *ep = msg->rpc;
-
- BUG_ON(!ep);
BUG_ON(!mutex_is_locked(&ep->mutex));
switch (msg->stage) {
diff --git a/fs/fuse/kio/pcs/pcs_rpc.h b/fs/fuse/kio/pcs/pcs_rpc.h
index f13274300f3e..baec7f844e38 100644
--- a/fs/fuse/kio/pcs/pcs_rpc.h
+++ b/fs/fuse/kio/pcs/pcs_rpc.h
@@ -323,6 +323,6 @@ static inline struct pcs_rpc *pcs_rpc_from_work(struct work_struct *wr)
const char* pcs_rpc_state_name(unsigned state);
void pcs_rpc_report_error(struct pcs_rpc *ep, unsigned int err);
-int pcs_rpc_cancel_msg(struct pcs_msg *msg);
+int pcs_rpc_cancel_msg(struct pcs_rpc *ep, struct pcs_msg *msg);
#endif /* _PCS_RPC_H_ */
More information about the Devel
mailing list