From ed164321371f17ae0f017c4fdd87ee08ff11ae71 Mon Sep 17 00:00:00 2001 From: Sebastien Buisson Date: Thu, 18 Feb 2021 20:03:31 +0900 Subject: [PATCH] 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. Lustre-change: https://review.whamcloud.com/41685 Lustre-commit: dfe87b089b662663ba125769866c98e803f89a8c Signed-off-by: Sebastien Buisson Change-Id: I6ae1f8b9da9600d3b57b9efc9018c2461114f2fe Reviewed-on: https://review.whamcloud.com/41858 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Andreas Dilger --- lustre/ptlrpc/sec.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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; -- 1.8.3.1