Skip to contentSkip to conversation

Patch "nfsd: work around a gcc-5.1 warning" has been added to the 3.18-stable tree

PATCH [email protected] 1 participant 1 message Apr 27, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

nfsd: work around a gcc-5.1 warning

to the 3.18-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:
nfsd-work-around-a-gcc-5.1-warning.patch
and it can be found in the queue-3.18 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 6ac75368e1a658903cf57b2bbf66e60d34f55558 Mon Sep 17 00:00:00 2001

From: Arnd Bergmann <[email protected]>
Date: Tue, 12 May 2015 23:31:29 +0200
Subject: nfsd: work around a gcc-5.1 warning

From: Arnd Bergmann <[email protected]>

commit 6ac75368e1a658903cf57b2bbf66e60d34f55558 upstream.

gcc-5.0 warns about a potential uninitialized variable use in nfsd:

fs/nfsd/nfs4state.c: In function 'nfsd4_process_open2':
fs/nfsd/nfs4state.c:3781:3: warning: 'old_deny_bmap' may be used uninitialized in this function [-Wmaybe-uninitialized]
reset_union_bmap_deny(old_deny_bmap, stp);
^
fs/nfsd/nfs4state.c:3760:16: note: 'old_deny_bmap' was declared here

  unsigned char old_deny_bmap;
                ^

This is a false positive, the code path that is warned about cannot actually be reached.

This adds an initialization for the variable to make the warning go away.

---
 fs/nfsd/nfs4state.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/nfsd/nfs4state.c +1 -2
@@ -3757,7 +3757,7 @@ static __be32
 nfs4_upgrade_open(struct svc_rqst *rqstp, struct nfs4_file *fp, struct svc_fh *cur_fh, struct nfs4_ol_stateid *stp, struct nfsd4_open *open)
 {
 	__be32 status;
-	unsigned char old_deny_bmap;
+	unsigned char old_deny_bmap = stp->st_deny_bmap;
 
 	if (!test_access(open->op_share_access, stp))
 		return nfs4_get_vfs_file(rqstp, fp, cur_fh, stp, open);
@@ -3766,7 +3766,6 @@ nfs4_upgrade_open(struct svc_rqst *rqstp
 	spin_lock(&fp->fi_lock);
 	status = nfs4_file_check_deny(fp, open->op_share_deny);
 	if (status == nfs_ok) {
-		old_deny_bmap = stp->st_deny_bmap;
 		set_deny(open->op_share_deny, stp);
 		fp->fi_share_deny |=
 				(open->op_share_deny & NFS4_SHARE_DENY_BOTH);

Patches currently in stable-queue which might be from [email protected] are

queue-3.18/perf-avoid-horrible-stack-usage.patch queue-3.18/mm-init-fix-zone-boundary-creation.patch queue-3.18/iommu-vt-d-remove-unused-variable.patch queue-3.18/nfsd-work-around-a-gcc-5.1-warning.patch queue-3.18/fs-nfs-fix-new-compiler-warning-about-boolean-in-switch.patch queue-3.18/acpi-power-avoid-maybe-uninitialized-warning.patch queue-3.18/gadgetfs-fix-uninitialized-variable-in-error-handling.patch queue-3.18/net-ti-cpmac-fix-compiler-warning-due-to-type-confusion.patch queue-3.18/clk-at91-usb-fix-determine_rate-prototype-again.patch queue-3.18/mips-fix-the-build-on-jz4740-after-removing-the-custom-gpio.h.patch queue-3.18/mips-asm-compiler-add-new-macros-to-set-isa-and-arch-asm-annotations.patch queue-3.18/dm-bufio-hide-bogus-warning.patch queue-3.18/fix-signed-unsigned-pointer-warning.patch