diff options
| author | Jeff Layton <jlayton@kernel.org> | 2025-08-11 10:37:07 -0400 |
|---|---|---|
| committer | Chuck Lever <chuck.lever@oracle.com> | 2025-09-21 19:24:50 -0400 |
| commit | a9a15ba23efc4d6d34127e8d175ae63a95434f58 (patch) | |
| tree | e7a36bff46457ceff88ee8776be5fb988e4cc20d | |
| parent | e4f574ca9c6dfa66695bb054ff5df43ecea873ec (diff) | |
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 <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
| -rw-r--r-- | net/sunrpc/svcsock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index e2c5e0e626f9..1afaeb45d6a3 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -1293,10 +1293,10 @@ out_notconn: mutex_unlock(&xprt->xpt_mutex); return -ENOTCONN; out_close: - pr_notice("rpc-srv/tcp: %s: %s %d when sending %d bytes - shutting down socket\n", + pr_notice("rpc-srv/tcp: %s: %s %d when sending %zu bytes - shutting down socket\n", xprt->xpt_server->sv_name, (err < 0) ? "got error" : "sent", - (err < 0) ? err : sent, xdr->len); + (err < 0) ? err : sent, xdr->len + sizeof(marker)); svc_xprt_deferred_close(xprt); mutex_unlock(&xprt->xpt_mutex); return -EAGAIN; |
