Skip to content

Commit a9a15ba

Browse files
jtlaytonchucklever
authored andcommitted
sunrpc: fix pr_notice in svc_tcp_sendto() to show correct length
This pr_notice() is confusing since it only prints xdr->len, which doesn't include the 4-byte record marker. That can make it sometimes look like the socket sent more than was requested if it's short by just a few bytes. Add sizeof(marker) to the size and fix the format accordingly. Signed-off-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent e4f574c commit a9a15ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/sunrpc/svcsock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,10 +1293,10 @@ static int svc_tcp_sendto(struct svc_rqst *rqstp)
12931293
mutex_unlock(&xprt->xpt_mutex);
12941294
return -ENOTCONN;
12951295
out_close:
1296-
pr_notice("rpc-srv/tcp: %s: %s %d when sending %d bytes - shutting down socket\n",
1296+
pr_notice("rpc-srv/tcp: %s: %s %d when sending %zu bytes - shutting down socket\n",
12971297
xprt->xpt_server->sv_name,
12981298
(err < 0) ? "got error" : "sent",
1299-
(err < 0) ? err : sent, xdr->len);
1299+
(err < 0) ? err : sent, xdr->len + sizeof(marker));
13001300
svc_xprt_deferred_close(xprt);
13011301
mutex_unlock(&xprt->xpt_mutex);
13021302
return -EAGAIN;

0 commit comments

Comments
 (0)