diff options
Diffstat (limited to 'net/sunrpc/svc.c')
-rw-r--r-- | net/sunrpc/svc.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index ca8a7958f4e6..2783fd80c229 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c | |||
@@ -28,6 +28,8 @@ | |||
28 | #include <linux/sunrpc/clnt.h> | 28 | #include <linux/sunrpc/clnt.h> |
29 | #include <linux/sunrpc/bc_xprt.h> | 29 | #include <linux/sunrpc/bc_xprt.h> |
30 | 30 | ||
31 | #include <trace/events/sunrpc.h> | ||
32 | |||
31 | #define RPCDBG_FACILITY RPCDBG_SVCDSP | 33 | #define RPCDBG_FACILITY RPCDBG_SVCDSP |
32 | 34 | ||
33 | static void svc_unregister(const struct svc_serv *serv, struct net *net); | 35 | static void svc_unregister(const struct svc_serv *serv, struct net *net); |
@@ -1040,7 +1042,7 @@ static void svc_unregister(const struct svc_serv *serv, struct net *net) | |||
1040 | /* | 1042 | /* |
1041 | * dprintk the given error with the address of the client that caused it. | 1043 | * dprintk the given error with the address of the client that caused it. |
1042 | */ | 1044 | */ |
1043 | #ifdef RPC_DEBUG | 1045 | #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) |
1044 | static __printf(2, 3) | 1046 | static __printf(2, 3) |
1045 | void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...) | 1047 | void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...) |
1046 | { | 1048 | { |
@@ -1314,24 +1316,25 @@ svc_process(struct svc_rqst *rqstp) | |||
1314 | rqstp->rq_res.tail[0].iov_base = NULL; | 1316 | rqstp->rq_res.tail[0].iov_base = NULL; |
1315 | rqstp->rq_res.tail[0].iov_len = 0; | 1317 | rqstp->rq_res.tail[0].iov_len = 0; |
1316 | 1318 | ||
1317 | rqstp->rq_xid = svc_getu32(argv); | ||
1318 | |||
1319 | dir = svc_getnl(argv); | 1319 | dir = svc_getnl(argv); |
1320 | if (dir != 0) { | 1320 | if (dir != 0) { |
1321 | /* direction != CALL */ | 1321 | /* direction != CALL */ |
1322 | svc_printk(rqstp, "bad direction %d, dropping request\n", dir); | 1322 | svc_printk(rqstp, "bad direction %d, dropping request\n", dir); |
1323 | serv->sv_stats->rpcbadfmt++; | 1323 | serv->sv_stats->rpcbadfmt++; |
1324 | svc_drop(rqstp); | 1324 | goto out_drop; |
1325 | return 0; | ||
1326 | } | 1325 | } |
1327 | 1326 | ||
1328 | /* Returns 1 for send, 0 for drop */ | 1327 | /* Returns 1 for send, 0 for drop */ |
1329 | if (svc_process_common(rqstp, argv, resv)) | 1328 | if (likely(svc_process_common(rqstp, argv, resv))) { |
1330 | return svc_send(rqstp); | 1329 | int ret = svc_send(rqstp); |
1331 | else { | 1330 | |
1332 | svc_drop(rqstp); | 1331 | trace_svc_process(rqstp, ret); |
1333 | return 0; | 1332 | return ret; |
1334 | } | 1333 | } |
1334 | out_drop: | ||
1335 | trace_svc_process(rqstp, 0); | ||
1336 | svc_drop(rqstp); | ||
1337 | return 0; | ||
1335 | } | 1338 | } |
1336 | 1339 | ||
1337 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) | 1340 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |