Skip to content

Commit a00275b

Browse files
chuckleveramschuma-ntap
authored andcommitted
SUNRPC: Make AUTH_SYS and AUTH_NULL set au_verfsize
au_verfsize will be needed for a non-flavor-specific computation in a subsequent patch. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent 02ef04e commit a00275b

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

include/linux/sunrpc/auth.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ struct rpc_auth {
7777
/* guess at number of u32's auth adds before
7878
* reply data; normally the verifier size: */
7979
unsigned int au_rslack;
80-
/* for gss, used to calculate au_rslack: */
81-
unsigned int au_verfsize;
80+
unsigned int au_verfsize; /* size of reply verifier */
8281

8382
unsigned int au_flags; /* various flags */
8483
const struct rpc_authops *au_ops; /* operations */

net/sunrpc/auth_gss/auth_gss.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,7 @@ gss_create_new(const struct rpc_auth_create_args *args, struct rpc_clnt *clnt)
10161016
auth = &gss_auth->rpc_auth;
10171017
auth->au_cslack = GSS_CRED_SLACK >> 2;
10181018
auth->au_rslack = GSS_VERF_SLACK >> 2;
1019+
auth->au_verfsize = GSS_VERF_SLACK >> 2;
10191020
auth->au_flags = 0;
10201021
auth->au_ops = &authgss_ops;
10211022
auth->au_flavor = flavor;

net/sunrpc/auth_null.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ static
114114
struct rpc_auth null_auth = {
115115
.au_cslack = NUL_CALLSLACK,
116116
.au_rslack = NUL_REPLYSLACK,
117+
.au_verfsize = NUL_REPLYSLACK,
117118
.au_ops = &authnull_ops,
118119
.au_flavor = RPC_AUTH_NULL,
119120
.au_count = REFCOUNT_INIT(1),

net/sunrpc/auth_unix.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ unx_refresh(struct rpc_task *task)
163163
static int
164164
unx_validate(struct rpc_task *task, struct xdr_stream *xdr)
165165
{
166+
struct rpc_auth *auth = task->tk_rqstp->rq_cred->cr_auth;
166167
__be32 *p;
167168
u32 size;
168169

@@ -184,7 +185,8 @@ unx_validate(struct rpc_task *task, struct xdr_stream *xdr)
184185
if (!p)
185186
return -EIO;
186187

187-
task->tk_rqstp->rq_cred->cr_auth->au_rslack = (size >> 2) + 2;
188+
auth->au_verfsize = XDR_QUADLEN(size) + 2;
189+
auth->au_rslack = XDR_QUADLEN(size) + 2;
188190
return 0;
189191
}
190192

@@ -212,6 +214,7 @@ static
212214
struct rpc_auth unix_auth = {
213215
.au_cslack = UNX_CALLSLACK,
214216
.au_rslack = NUL_REPLYSLACK,
217+
.au_verfsize = NUL_REPLYSLACK,
215218
.au_ops = &authunix_ops,
216219
.au_flavor = RPC_AUTH_UNIX,
217220
.au_count = REFCOUNT_INIT(1),

0 commit comments

Comments
 (0)