]> git.baikalelectronics.ru Git - kernel.git/commit
NFSv4.1: work around -Wmaybe-uninitialized warning
authorArnd Bergmann <arnd@arndb.de>
Mon, 17 Oct 2016 22:05:35 +0000 (00:05 +0200)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Mon, 24 Oct 2016 17:54:43 +0000 (13:54 -0400)
commit2c95a2784b938c8cd9d9224bf31b2d7543ea1078
treeb58288358e24fceb42f0b45b962b0a356870ce8f
parent97f0c5a53f3f3926643bf6923d4ca6607b1dc282
NFSv4.1: work around -Wmaybe-uninitialized warning

A bugfix introduced a harmless gcc warning in nfs4_slot_seqid_in_use
if we enable -Wmaybe-uninitialized again:

fs/nfs/nfs4session.c:203:54: error: 'cur_seq' may be used uninitialized in this function [-Werror=maybe-uninitialized]

gcc is not smart enough to conclude that the IS_ERR/PTR_ERR pair
results in a nonzero return value here. Using PTR_ERR_OR_ZERO()
instead makes this clear to the compiler.

The warning originally did not appear in v4.8 as it was globally
disabled, but the bugfix that introduced the warning got backported
to stable kernels which again enable it, and this is now the only
warning in the v4.7 builds.

Fixes: 0e06b7818f7a ("NFSv4.1: Fix Oopsable condition in server callback races")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/nfs4session.c