Whamcloud - gitweb
LU-14444 gss: handle empty reqmsg in sptlrpc_req_ctx_switch 85/41685/2
authorSebastien Buisson <sbuisson@ddn.com>
Thu, 18 Feb 2021 11:03:31 +0000 (20:03 +0900)
committerOleg Drokin <green@whamcloud.com>
Mon, 22 Feb 2021 19:28:55 +0000 (19:28 +0000)
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 <sbuisson@ddn.com>
Change-Id: I6ae1f8b9da9600d3b57b9efc9018c2461114f2fe
Reviewed-on: https://review.whamcloud.com/41685
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: Oleg Drokin <green@whamcloud.com>
lustre/ptlrpc/sec.c

index 27da5c8..dc2f7c8 100644 (file)
@@ -492,15 +492,11 @@ int sptlrpc_req_ctx_switch(struct ptlrpc_request *req,
                           struct ptlrpc_cli_ctx *oldctx,
                           struct ptlrpc_cli_ctx *newctx)
 {
                           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;
 
        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,
        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) {
        /* 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;
                OBD_ALLOC_LARGE(reqmsg, reqmsg_size);
                if (reqmsg == NULL)
                        return -ENOMEM;