SUNRPC: Move svcxdr_init_decode() into ->accept methods
authorChuck Lever <chuck.lever@oracle.com>
Mon, 2 Jan 2023 17:05:37 +0000 (12:05 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 20 Feb 2023 14:20:09 +0000 (09:20 -0500)
Refactor: So that the overhaul of each ->accept method can be done
in separate smaller patches, temporarily move the
svcxdr_init_decode() call into those methods.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
net/sunrpc/auth_gss/svcauth_gss.c
net/sunrpc/svc.c
net/sunrpc/svcauth_unix.c

index acb822b23af1b01cd0b30d8346813bb671920901..a27f924b8906b8de71476838336b86780fea448b 100644 (file)
@@ -1280,6 +1280,7 @@ static int svcauth_gss_legacy_init(struct svc_rqst *rqstp,
                           rsip->major_status, rsip->minor_status))
                goto out;
 
+       svcxdr_init_decode(rqstp);
        ret = SVC_COMPLETE;
 out:
        cache_put(&rsip->h, sn->rsi_cache);
@@ -1408,6 +1409,7 @@ static int svcauth_gss_proxy_init(struct svc_rqst *rqstp,
                           ud.major_status, ud.minor_status))
                goto out;
 
+       svcxdr_init_decode(rqstp);
        ret = SVC_COMPLETE;
 out:
        gss_free_in_token_pages(&ud.in_token);
@@ -1644,6 +1646,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp)
                rqstp->rq_auth_stat = rpc_autherr_badcred;
                switch (gc->gc_svc) {
                case RPC_GSS_SVC_NONE:
+                       svcxdr_init_decode(rqstp);
                        break;
                case RPC_GSS_SVC_INTEGRITY:
                        /* placeholders for length and seq. number: */
@@ -1653,6 +1656,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp)
                                        gc->gc_seq, rsci->mechctx))
                                goto garbage_args;
                        rqstp->rq_auth_slack = RPC_MAX_AUTH_SIZE;
+                       svcxdr_init_decode(rqstp);
                        break;
                case RPC_GSS_SVC_PRIVACY:
                        /* placeholders for length and seq. number: */
@@ -1662,6 +1666,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp)
                                        gc->gc_seq, rsci->mechctx))
                                goto garbage_args;
                        rqstp->rq_auth_slack = RPC_MAX_AUTH_SIZE * 2;
+                       svcxdr_init_decode(rqstp);
                        break;
                default:
                        goto auth_err;
index 8d1700e2ce1d8f79a8746b4caaaba7909d72322e..f06622814a958a5248d8407dd60024360c9019c9 100644 (file)
@@ -1302,7 +1302,6 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
        if (progp == NULL)
                goto err_bad_prog;
 
-       svcxdr_init_decode(rqstp);
        rpc_stat = progp->pg_init_request(rqstp, progp, &process);
        switch (rpc_stat) {
        case rpc_success:
index b1efc34db6ed8b20e5076f0115142055b9ce29e9..3a77f3be2cf0ad81b8186e45deb6e7805ce2a0b6 100644 (file)
@@ -762,6 +762,7 @@ svcauth_null_accept(struct svc_rqst *rqstp)
        svc_putnl(resv, 0);
 
        rqstp->rq_cred.cr_flavor = RPC_AUTH_NULL;
+       svcxdr_init_decode(rqstp);
        return SVC_OK;
 }
 
@@ -835,6 +836,7 @@ svcauth_tls_accept(struct svc_rqst *rqstp)
                svc_putnl(resv, 0);
 
        rqstp->rq_cred.cr_flavor = RPC_AUTH_TLS;
+       svcxdr_init_decode(rqstp);
        return SVC_OK;
 }
 
@@ -900,6 +902,7 @@ svcauth_unix_accept(struct svc_rqst *rqstp)
        svc_putnl(resv, 0);
 
        rqstp->rq_cred.cr_flavor = RPC_AUTH_UNIX;
+       svcxdr_init_decode(rqstp);
        return SVC_OK;
 
 badcred: