Response to userspace requests should not be analyzed and translated
to msg->errors. Instead the entire response message should be just
passed to userspace and let userspace handle it.

Fix the issue that userspace krpcio getting aborted by PCS_RPC_ERROR_RESP
response.

Signed-off-by: Liu Kui <kui....@virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_rpc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/fs/fuse/kio/pcs/pcs_rpc.c b/fs/fuse/kio/pcs/pcs_rpc.c
index deebc1dddf1b..f990f0f30609 100644
--- a/fs/fuse/kio/pcs/pcs_rpc.c
+++ b/fs/fuse/kio/pcs/pcs_rpc.c
@@ -484,6 +484,12 @@ static void handle_response(struct pcs_rpc * ep, struct 
pcs_msg * msg)
        pcs_msg_del_calendar(req);
        list_del(&req->list);
 
+       /* don't try to interpret response to request from userspace */
+       if (!(h->xid.origin.val & PCS_NODE_ALT_MASK)) {
+               req->response = msg;
+               goto skip;
+       }
+
        if (h->type == PCS_RPC_ERROR_RESP) {
                struct pcs_rpc_error_resp * eh = (struct pcs_rpc_error_resp 
*)msg->_inline_buffer;
 
@@ -502,6 +508,7 @@ static void handle_response(struct pcs_rpc * ep, struct 
pcs_msg * msg)
                        req->response = msg;
        }
 
+skip:
        if (ep->ops->hook_response)
                ep->ops->hook_response(ep, req);
 
-- 
2.39.3 (Apple Git-146)

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to