Whamcloud - gitweb
LU-12523 ptlrpc: Stop sending ptlrpc_body_v2 83/35583/3
authorPatrick Farrell <pfarrell@whamcloud.com>
Mon, 22 Jul 2019 18:02:28 +0000 (14:02 -0400)
committerOleg Drokin <green@whamcloud.com>
Tue, 3 Sep 2019 05:11:10 +0000 (05:11 +0000)
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 <pfarrell@whamcloud.com>
Change-Id: I54fc9a174788235c43fe9101a1b42adc7f547847
Reviewed-on: https://review.whamcloud.com/35583
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <stancheff@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ptlrpc/client.c
lustre/ptlrpc/niobuf.c
lustre/ptlrpc/pack_generic.c

index e43cd01..3789162 100644 (file)
@@ -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);
 
index 503ce69..6ab5d46 100644 (file)
@@ -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;
 
index 1d33649..de9437c 100644 (file)
@@ -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);