]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
SUNRPC: fix ternary sign expansion bug in tracing
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 22 Apr 2021 09:14:37 +0000 (12:14 +0300)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 18 Jun 2021 09:07:15 +0000 (11:07 +0200)
commit4877f24fbf46a6088d81b1e4d841403a3c592e9a
tree176dddbe05da32a948f63c80d45a7970ce65c816
parent4fba8a61f6cd27ac579f544c8e95ebfb47fc55ba
SUNRPC: fix ternary sign expansion bug in tracing

BugLink: https://bugs.launchpad.net/bugs/1931292
[ Upstream commit cb579086536f6564f5846f89808ec394ef8b8621 ]

This code is supposed to pass negative "err" values for tracing but it
passes positive values instead.  The problem is that the
trace_svcsock_tcp_send() function takes a long but "err" is an int and
"sent" is a u32.  The negative is first type promoted to u32 so it
becomes a high positive then it is promoted to long and it stays
positive.

Fix this by casting "err" directly to long.

Fixes: 998024dee197 ("SUNRPC: Add more svcsock tracepoints")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
net/sunrpc/svcsock.c