From patchwork Thu Feb 27 21:15:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11410421 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 48DB092A for ; Thu, 27 Feb 2020 21:38:00 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3155024690 for ; Thu, 27 Feb 2020 21:38:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3155024690 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 90F94349775; Thu, 27 Feb 2020 13:31:10 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 0D06D21FF56 for ; Thu, 27 Feb 2020 13:20:36 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id 7A2E78F32; Thu, 27 Feb 2020 16:18:18 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 78AEE46A; Thu, 27 Feb 2020 16:18:18 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 27 Feb 2020 16:15:10 -0500 Message-Id: <1582838290-17243-443-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> References: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 442/622] lustre: ptlrpc: Stop sending ptlrpc_body_v2 X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Patrick Farrell 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. WC-bug-id: https://jira.whamcloud.com/browse/LU-12523 Lustre-commit: fb18c05c0f5e ("LU-12523 ptlrpc: Stop sending ptlrpc_body_v2") Signed-off-by: Patrick Farrell Reviewed-on: https://review.whamcloud.com/35583 Reviewed-by: Andreas Dilger Reviewed-by: Shaun Tancheff Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- fs/lustre/ptlrpc/client.c | 27 +-------------------------- fs/lustre/ptlrpc/niobuf.c | 11 ----------- fs/lustre/ptlrpc/pack_generic.c | 16 ++-------------- 3 files changed, 3 insertions(+), 51 deletions(-) diff --git a/fs/lustre/ptlrpc/client.c b/fs/lustre/ptlrpc/client.c index dcc5e6b..c750a4e 100644 --- a/fs/lustre/ptlrpc/client.c +++ b/fs/lustre/ptlrpc/client.c @@ -817,32 +817,7 @@ int ptlrpc_request_bufs_pack(struct ptlrpc_request *request, 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 interoperability 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 interoperability 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/fs/lustre/ptlrpc/niobuf.c b/fs/lustre/ptlrpc/niobuf.c index 2e866fe..9d9e94c 100644 --- a/fs/lustre/ptlrpc/niobuf.c +++ b/fs/lustre/ptlrpc/niobuf.c @@ -388,17 +388,6 @@ int ptlrpc_send_reply(struct ptlrpc_request *req, int flags) req->rq_export->exp_obd->obd_minor); } - /* In order to keep interoperability 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 whenever we drop the interoperability 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/fs/lustre/ptlrpc/pack_generic.c b/fs/lustre/ptlrpc/pack_generic.c index 6a4ea7a..e63720b 100644 --- a/fs/lustre/ptlrpc/pack_generic.c +++ b/fs/lustre/ptlrpc/pack_generic.c @@ -91,21 +91,9 @@ bool ptlrpc_buf_need_swab(struct ptlrpc_request *req, const int inout, /* early reply size */ u32 lustre_msg_early_size(void) { - static u32 size; - - if (!size) { - /* Always reply old ptlrpc_body_v2 to keep interoperability - * with the old client (< 2.3) which doesn't have pb_jobid - * in the ptlrpc_body. - * - * XXX Remove this whenever we drop interoperability with such - * client. - */ - u32 pblen = sizeof(struct ptlrpc_body_v2); + u32 pblen = sizeof(struct ptlrpc_body); - size = lustre_msg_size(LUSTRE_MSG_MAGIC_V2, 1, &pblen); - } - return size; + return lustre_msg_size(LUSTRE_MSG_MAGIC_V2, 1, &pblen); } EXPORT_SYMBOL(lustre_msg_early_size);