linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 8312/9080] fs/nfsd/nfs3xdr.c:299:6: warning: variable 'err' is used uninitialized whenever 'if' condition is false
@ 2020-11-28  7:31 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-11-28  7:31 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: kbuild-all, clang-built-linux, Linux Memory Management List, Chuck Lever

[-- Attachment #1: Type: text/plain, Size: 3088 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   6174f05255e65622ff3340257879a4c0f858b0df
commit: 5d9a63c9a697c3d5dbf0a63d11da05ecc4c461fa [8312/9080] nfsd: skip some unnecessary stats in the v4 case
config: x86_64-randconfig-a012-20201128 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 979bcbd3a6f7ea784f2098ad4cf613fbd6b09e38)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=5d9a63c9a697c3d5dbf0a63d11da05ecc4c461fa
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 5d9a63c9a697c3d5dbf0a63d11da05ecc4c461fa
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> fs/nfsd/nfs3xdr.c:299:6: warning: variable 'err' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           if (!v4 || !inode->i_sb->s_export_op->fetch_iversion)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/nfsd/nfs3xdr.c:304:6: note: uninitialized use occurs here
           if (err) {
               ^~~
   fs/nfsd/nfs3xdr.c:299:2: note: remove the 'if' if its condition is always true
           if (!v4 || !inode->i_sb->s_export_op->fetch_iversion)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/nfsd/nfs3xdr.c:293:12: note: initialize the variable 'err' to silence this warning
           __be32 err;
                     ^
                      = 0
   1 warning generated.

vim +299 fs/nfsd/nfs3xdr.c

   285	
   286	/*
   287	 * Fill in the post_op attr for the wcc data
   288	 */
   289	void fill_post_wcc(struct svc_fh *fhp)
   290	{
   291		bool v4 = (fhp->fh_maxsize == NFS4_FHSIZE);
   292		struct inode *inode = d_inode(fhp->fh_dentry);
   293		__be32 err;
   294	
   295		if (fhp->fh_post_saved)
   296			printk("nfsd: inode locked twice during operation.\n");
   297	
   298	
 > 299		if (!v4 || !inode->i_sb->s_export_op->fetch_iversion)
   300			err = fh_getattr(fhp, &fhp->fh_post_attr);
   301		if (v4)
   302			fhp->fh_post_change =
   303				nfsd4_change_attribute(&fhp->fh_post_attr, inode);
   304		if (err) {
   305			fhp->fh_post_saved = false;
   306			/* Grab the ctime anyway - set_change_info might use it */
   307			fhp->fh_post_attr.ctime = inode->i_ctime;
   308		} else
   309			fhp->fh_post_saved = true;
   310	}
   311	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 39422 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-28  7:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-28  7:31 [linux-next:master 8312/9080] fs/nfsd/nfs3xdr.c:299:6: warning: variable 'err' is used uninitialized whenever 'if' condition is false kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).