Skip to content

Commit 6d037b1

Browse files
committed
SUNRPC: Remove the rpc_stat variable in svc_process_common()
There's no RPC header field called rpc_stat; more precisely, the variable appears to be recording an accept_stat value. But it looks like we don't need to preserve this value at all, actually, so simply remove the variable. Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 99d074d commit 6d037b1

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

net/sunrpc/svc.c

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,12 +1232,9 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *resv)
12321232
struct svc_serv *serv = rqstp->rq_server;
12331233
struct svc_process_info process;
12341234
__be32 *p, *statp;
1235-
__be32 rpc_stat;
12361235
int auth_res, rc;
12371236
__be32 *reply_statp;
12381237

1239-
rpc_stat = rpc_success;
1240-
12411238
/* Will be turned off by GSS integrity and privacy services */
12421239
set_bit(RQ_SPLICE_OK, &rqstp->rq_flags);
12431240
/* Will be turned off only when NFSv4 Sessions are used */
@@ -1279,10 +1276,9 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *resv)
12791276
case SVC_OK:
12801277
break;
12811278
case SVC_GARBAGE:
1282-
goto err_garbage;
1279+
goto err_garbage_args;
12831280
case SVC_SYSERR:
1284-
rpc_stat = rpc_system_err;
1285-
goto err_bad;
1281+
goto err_system_err;
12861282
case SVC_DENIED:
12871283
goto err_bad_auth;
12881284
case SVC_CLOSE:
@@ -1296,8 +1292,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *resv)
12961292
if (progp == NULL)
12971293
goto err_bad_prog;
12981294

1299-
rpc_stat = progp->pg_init_request(rqstp, progp, &process);
1300-
switch (rpc_stat) {
1295+
switch (progp->pg_init_request(rqstp, progp, &process)) {
13011296
case rpc_success:
13021297
break;
13031298
case rpc_prog_unavail:
@@ -1408,13 +1403,16 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *resv)
14081403
svc_putnl(resv, RPC_PROC_UNAVAIL);
14091404
goto sendit;
14101405

1411-
err_garbage:
1412-
svc_printk(rqstp, "failed to decode args\n");
1406+
err_garbage_args:
1407+
svc_printk(rqstp, "failed to decode RPC header\n");
1408+
1409+
serv->sv_stats->rpcbadfmt++;
1410+
svc_putnl(resv, RPC_GARBAGE_ARGS);
1411+
goto sendit;
14131412

1414-
rpc_stat = rpc_garbage_args;
1415-
err_bad:
1413+
err_system_err:
14161414
serv->sv_stats->rpcbadfmt++;
1417-
svc_putnl(resv, ntohl(rpc_stat));
1415+
svc_putnl(resv, RPC_SYSTEM_ERR);
14181416
goto sendit;
14191417
}
14201418

0 commit comments

Comments
 (0)