From: Sebastien Buisson Date: Thu, 18 Feb 2021 11:03:31 +0000 (+0900) Subject: LU-14444 gss: handle empty reqmsg in sptlrpc_req_ctx_switch X-Git-Tag: 2.14.51~179 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=dfe87b089b662663ba125769866c98e803f89a8c LU-14444 gss: handle empty reqmsg in sptlrpc_req_ctx_switch In sptlrpc_req_ctx_switch(), everything is already there to handle the case of a ptlrpc_request that has an empty rq_reqmsg. But assertions were left over at the beginning of the function, so just remove them from here. Signed-off-by: Sebastien Buisson Change-Id: I6ae1f8b9da9600d3b57b9efc9018c2461114f2fe Reviewed-on: https://review.whamcloud.com/41685 Reviewed-by: Andreas Dilger Tested-by: jenkins Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Tested-by: Oleg Drokin --- diff --git a/lustre/ptlrpc/sec.c b/lustre/ptlrpc/sec.c index 27da5c8..dc2f7c8 100644 --- a/lustre/ptlrpc/sec.c +++ b/lustre/ptlrpc/sec.c @@ -492,15 +492,11 @@ int sptlrpc_req_ctx_switch(struct ptlrpc_request *req, struct ptlrpc_cli_ctx *oldctx, struct ptlrpc_cli_ctx *newctx) { - struct sptlrpc_flavor old_flvr; + struct sptlrpc_flavor old_flvr; char *reqmsg = NULL; /* to workaround old gcc */ int reqmsg_size; int rc = 0; - LASSERT(req->rq_reqmsg); - LASSERT(req->rq_reqlen); - LASSERT(req->rq_replen); - CDEBUG(D_SEC, "req %p: switch ctx %p(%u->%s) -> %p(%u->%s), switch sec %p(%s) -> %p(%s)\n", req, oldctx, oldctx->cc_vcred.vc_uid, @@ -515,6 +511,7 @@ int sptlrpc_req_ctx_switch(struct ptlrpc_request *req, /* save request message */ reqmsg_size = req->rq_reqlen; if (reqmsg_size != 0) { + LASSERT(req->rq_reqmsg); OBD_ALLOC_LARGE(reqmsg, reqmsg_size); if (reqmsg == NULL) return -ENOMEM;