From: kernel test robot <lkp@intel.com>
To: "J. Bruce Fields" <bfields@redhat.com>
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
Linux Memory Management List <linux-mm@kvack.org>,
Chuck Lever <chuck.lever@oracle.com>
Subject: [linux-next:master 8312/9080] fs/nfsd/nfs3xdr.c:299:6: warning: variable 'err' is used uninitialized whenever 'if' condition is false
Date: Sat, 28 Nov 2020 15:31:25 +0800 [thread overview]
Message-ID: <202011281523.bTMqo60z-lkp@intel.com> (raw)
[-- 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 --]
reply other threads:[~2020-11-28 7:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202011281523.bTMqo60z-lkp@intel.com \
--to=lkp@intel.com \
--cc=bfields@redhat.com \
--cc=chuck.lever@oracle.com \
--cc=clang-built-linux@googlegroups.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).