net: sunrpc: Fix 'snprintf' return value check in 'do_xprt_debugfs'
authorFedor Tokarev <ftokarev@gmail.com>
Thu, 15 Oct 2020 13:59:08 +0000 (16:59 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:53:30 +0000 (11:53 +0100)
commit7941ee42dccabbbea7be8985f73945c5caaacc57
tree3299d5eb82f4e0f11444ce353cf05164049d1c6d
parent77303b6b5e4a27f6bb08a334451c95889a049ccd
net: sunrpc: Fix 'snprintf' return value check in 'do_xprt_debugfs'

[ Upstream commit 35a6d396721e28ba161595b0fc9e8896c00399bb ]

'snprintf' returns the number of characters which would have been written
if enough space had been available, excluding the terminating null byte.
Thus, the return value of 'sizeof(buf)' means that the last character
has been dropped.

Signed-off-by: Fedor Tokarev <ftokarev@gmail.com>
Fixes: 2f34b8bfae19 ("SUNRPC: add links for all client xprts to debugfs")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sunrpc/debugfs.c