Patch "NFSv4.x: hide array-bounds warning" has been added to the 4.4-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
NFSv4.x: hide array-bounds warning
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
nfsv4.x-hide-array-bounds-warning.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
d55b352b01bc78fbc3d1bb650140668b87e58bf9Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <[email protected]>
Date: Tue, 22 Nov 2016 21:50:52 +0100
Subject: NFSv4.x: hide array-bounds warning
From: Arnd Bergmann <[email protected]>
commit d55b352b01bc78fbc3d1bb650140668b87e58bf9 upstream.
A correct bugfix introduced a harmless warning that shows up with gcc-7:
fs/nfs/callback.c: In function 'nfs_callback_up':fs/nfs/callback.c:214:14: error: array subscript is outside array bounds [-Werror=array-bounds]
What happens here is that the 'minorversion == 0' check tells the compiler that we assume minorversion can be something other than 0, but when CONFIG_NFS_V4_1 is disabled that would be invalid and result in an out-of-bounds access.
The added check for IS_ENABLED(CONFIG_NFS_V4_1) tells gcc that this really can't happen, which makes the code slightly smaller and also avoids the warning.
The bugfix that introduced the warning is marked for stable backports, we want this one backported to the same releases.
--- fs/nfs/callback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/callback.c +1 -1
@@ -261,7 +261,7 @@ static int nfs_callback_up_net(int minor } ret = -EPROTONOSUPPORT ; -if (minorversion ==0 ) +if (!IS_ENABLED (CONFIG_NFS_V4_1 ) || minorversion ==0 ) ret =nfs4_callback_up_net (serv, net);else if (xprt->ops->bc_up) ret = xprt->ops->bc_up (serv, net);
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/nfsv4.x-hide-array-bounds-warning.patch