From fb18c05c0f5ee50bbd782334744028c912658c70 Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Mon, 22 Jul 2019 14:02:28 -0400 Subject: [PATCH] LU-12523 ptlrpc: Stop sending ptlrpc_body_v2 ptlrpc_body_v2 does not include space for jobids, that means that when we added jobid to the RPC debug messages, we started getting errors like this: LustreError: 6817:0:(pack_generic.c:425:lustre_msg_buf_v2()) msg 000000005c83b7a2 buffer[0] size 152 too small (required 184, opc=-1) This happened every time we tried to print a ptlrpc_body_v2 message. body_v2 is still sent on some RPCs for compatibility with very old versions of Lustre, but we no longer support interop with those versions (latest reported is 2.3). So, stop sending ptlrpc_body_v2 on any RPCs. Note that we need to retain the ptlrpc_body_v2 definitions and parsing capability for interop with servers which still use them for some messages, which is all prior to this patch. One further note: This does *not* fix the case of newer clients collecting rpctrace with older servers. They will still see the error message for some RPCs. That could be fixed with tweaks to the debug printing code. Signed-off-by: Patrick Farrell Change-Id: I54fc9a174788235c43fe9101a1b42adc7f547847 Reviewed-on: https://review.whamcloud.com/35583 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Shaun Tancheff Reviewed-by: Oleg Drokin --- lustre/ptlrpc/client.c | 27 +-------------------------- lustre/ptlrpc/niobuf.c | 10 ---------- lustre/ptlrpc/pack_generic.c | 16 +++------------- 3 files changed, 4 insertions(+), 49 deletions(-) diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index e43cd01..3789162 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -841,32 +841,7 @@ EXPORT_SYMBOL(ptlrpc_request_bufs_pack); int ptlrpc_request_pack(struct ptlrpc_request *request, __u32 version, int opcode) { - int rc; - - rc = ptlrpc_request_bufs_pack(request, version, opcode, NULL, NULL); - if (rc) - return rc; - - /* - * For some old 1.8 clients (< 1.8.7), they will LASSERT the size of - * ptlrpc_body sent from server equal to local ptlrpc_body size, so we - * have to send old ptlrpc_body to keep interoprability with these - * clients. - * - * Only three kinds of server->client RPCs so far: - * - LDLM_BL_CALLBACK - * - LDLM_CP_CALLBACK - * - LDLM_GL_CALLBACK - * - * XXX This should be removed whenever we drop the interoprability with - * the these old clients. - */ - if (opcode == LDLM_BL_CALLBACK || opcode == LDLM_CP_CALLBACK || - opcode == LDLM_GL_CALLBACK) - req_capsule_shrink(&request->rq_pill, &RMF_PTLRPC_BODY, - sizeof(struct ptlrpc_body_v2), RCL_CLIENT); - - return rc; + return ptlrpc_request_bufs_pack(request, version, opcode, NULL, NULL); } EXPORT_SYMBOL(ptlrpc_request_pack); diff --git a/lustre/ptlrpc/niobuf.c b/lustre/ptlrpc/niobuf.c index 503ce69..6ab5d46 100644 --- a/lustre/ptlrpc/niobuf.c +++ b/lustre/ptlrpc/niobuf.c @@ -593,16 +593,6 @@ int ptlrpc_send_reply(struct ptlrpc_request *req, int flags) req->rq_export->exp_obd->obd_minor); } - /* In order to keep interoprability with the client (< 2.3) which - * doesn't have pb_jobid in ptlrpc_body, We have to shrink the - * ptlrpc_body in reply buffer to ptlrpc_body_v2, otherwise, the - * reply buffer on client will be overflow. - * - * XXX Remove this whenver we drop the interoprability with such client. - */ - req->rq_replen = lustre_shrink_msg(req->rq_repmsg, 0, - sizeof(struct ptlrpc_body_v2), 1); - if (req->rq_type != PTL_RPC_MSG_ERR) req->rq_type = PTL_RPC_MSG_REPLY; diff --git a/lustre/ptlrpc/pack_generic.c b/lustre/ptlrpc/pack_generic.c index 1d33649..de9437c 100644 --- a/lustre/ptlrpc/pack_generic.c +++ b/lustre/ptlrpc/pack_generic.c @@ -116,19 +116,9 @@ int lustre_msg_check_version(struct lustre_msg *msg, /* early reply size */ __u32 lustre_msg_early_size() { - static __u32 size; - if (!size) { - /* Always reply old ptlrpc_body_v2 to keep interoprability - * with the old client (< 2.3) which doesn't have pb_jobid - * in the ptlrpc_body. - * - * XXX Remove this whenever we dorp interoprability with such - * client. - */ - __u32 pblen = sizeof(struct ptlrpc_body_v2); - size = lustre_msg_size(LUSTRE_MSG_MAGIC_V2, 1, &pblen); - } - return size; + __u32 pblen = sizeof(struct ptlrpc_body); + + return lustre_msg_size(LUSTRE_MSG_MAGIC_V2, 1, &pblen); } EXPORT_SYMBOL(lustre_msg_early_size); -- 1.8.3.1