Hi,
I love your patch! Perhaps something to improve:
[auto build test WARNING on nfs/linux-next]
[also build test WARNING on v5.14 next-20210909]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/schumaker-anna-gmail-com/Clean-u...
base:
git://git.linux-nfs.org/projects/trondmy/linux-nfs.git linux-next
config: x86_64-randconfig-a011-20210908 (attached as .config)
compiler: clang version 14.0.0 (
https://github.com/llvm/llvm-project
261cbe98c38f8c1ee1a482fe76511110e790f58a)
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
#
https://github.com/0day-ci/linux/commit/38f3262acfdb163684e4766fa514e85d9...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
schumaker-anna-gmail-com/Clean-up-nfs4_label-allocation/20210910-041620
git checkout 38f3262acfdb163684e4766fa514e85d93c0f507
# 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(a)intel.com>
All warnings (new ones prefixed by >>):
> fs/nfs/dir.c:1771:6: warning: variable 'error' is used
uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (fhandle == NULL || fattr == NULL)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/nfs/dir.c:1800:44: note: uninitialized use occurs here
trace_nfs_lookup_exit(dir, dentry, flags, error);
^~~~~
fs/nfs/dir.c:1771:2: note: remove the 'if' if its condition is always false
if (fhandle == NULL || fattr == NULL)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> fs/nfs/dir.c:1771:6: warning: variable 'error' is used
uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
if (fhandle == NULL || fattr == NULL)
^~~~~~~~~~~~~~~
fs/nfs/dir.c:1800:44: note: uninitialized use occurs here
trace_nfs_lookup_exit(dir, dentry, flags, error);
^~~~~
fs/nfs/dir.c:1771:6: note: remove the '||' if its condition is always false
if (fhandle == NULL || fattr == NULL)
^~~~~~~~~~~~~~~~~~
fs/nfs/dir.c:1753:11: note: initialize the variable 'error' to silence this
warning
int error;
^
= 0
2 warnings generated.
vim +1771 fs/nfs/dir.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 1745
597d92891b8859 Bryan Schumaker 2012-07-16 1746 struct dentry *nfs_lookup(struct inode
*dir, struct dentry * dentry, unsigned int flags)
^1da177e4c3f41 Linus Torvalds 2005-04-16 1747 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 1748 struct dentry *res;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1749 struct inode *inode = NULL;
e1fb4d05d5a326 Trond Myklebust 2010-04-16 1750 struct nfs_fh *fhandle = NULL;
e1fb4d05d5a326 Trond Myklebust 2010-04-16 1751 struct nfs_fattr *fattr = NULL;
a1147b8281bda9 Trond Myklebust 2020-02-05 1752 unsigned long dir_verifier;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1753 int error;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1754
6de1472f1a4a3b Al Viro 2013-09-16 1755 dfprintk(VFS, "NFS:
lookup(%pd2)\n", dentry);
91d5b47023b608 Chuck Lever 2006-03-20 1756 nfs_inc_stats(dir, NFSIOS_VFSLOOKUP);
^1da177e4c3f41 Linus Torvalds 2005-04-16 1757
130f9ab75dc3af Al Viro 2016-03-07 1758 if (unlikely(dentry->d_name.len >
NFS_SERVER(dir)->namelen))
130f9ab75dc3af Al Viro 2016-03-07 1759 return ERR_PTR(-ENAMETOOLONG);
^1da177e4c3f41 Linus Torvalds 2005-04-16 1760
fd6840714d9cf6 Trond Myklebust 2006-09-05 1761 /*
fd6840714d9cf6 Trond Myklebust 2006-09-05 1762 * If we're doing an exclusive
create, optimize away the lookup
fd6840714d9cf6 Trond Myklebust 2006-09-05 1763 * but don't hash the dentry.
fd6840714d9cf6 Trond Myklebust 2006-09-05 1764 */
9f6d44d418b1f4 Trond Myklebust 2018-05-10 1765 if (nfs_is_exclusive_create(dir, flags)
|| flags & LOOKUP_RENAME_TARGET)
130f9ab75dc3af Al Viro 2016-03-07 1766 return NULL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1767
e1fb4d05d5a326 Trond Myklebust 2010-04-16 1768 res = ERR_PTR(-ENOMEM);
e1fb4d05d5a326 Trond Myklebust 2010-04-16 1769 fhandle = nfs_alloc_fhandle();
38f3262acfdb16 Anna Schumaker 2021-09-09 1770 fattr =
nfs_alloc_fattr_with_label(NFS_SERVER(dir));
e1fb4d05d5a326 Trond Myklebust 2010-04-16 @1771 if (fhandle == NULL || fattr == NULL)
e1fb4d05d5a326 Trond Myklebust 2010-04-16 1772 goto out;
e1fb4d05d5a326 Trond Myklebust 2010-04-16 1773
a1147b8281bda9 Trond Myklebust 2020-02-05 1774 dir_verifier =
nfs_save_change_attribute(dir);
6e0d0be715fe04 Trond Myklebust 2013-08-20 1775 trace_nfs_lookup_enter(dir, dentry,
flags);
38f3262acfdb16 Anna Schumaker 2021-09-09 1776 error = NFS_PROTO(dir)->lookup(dir,
dentry, fhandle, fattr);
^1da177e4c3f41 Linus Torvalds 2005-04-16 1777 if (error == -ENOENT)
^1da177e4c3f41 Linus Torvalds 2005-04-16 1778 goto no_entry;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1779 if (error < 0) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 1780 res = ERR_PTR(error);
38f3262acfdb16 Anna Schumaker 2021-09-09 1781 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1782 }
38f3262acfdb16 Anna Schumaker 2021-09-09 1783 inode = nfs_fhget(dentry->d_sb,
fhandle, fattr, fattr->label);
bf0c84f1614bff Namhyung Kim 2010-12-28 1784 res = ERR_CAST(inode);
03f28e3a2059fc Trond Myklebust 2006-03-20 1785 if (IS_ERR(res))
38f3262acfdb16 Anna Schumaker 2021-09-09 1786 goto out;
54ceac45159860 David Howells 2006-08-22 1787
63519fbc67d0d9 Trond Myklebust 2016-11-19 1788 /* Notify readdir to use READDIRPLUS */
63519fbc67d0d9 Trond Myklebust 2016-11-19 1789 nfs_force_use_readdirplus(dir);
d69ee9b85541a6 Trond Myklebust 2012-05-01 1790
^1da177e4c3f41 Linus Torvalds 2005-04-16 1791 no_entry:
41d28bca2da4bd Al Viro 2014-10-12 1792 res = d_splice_alias(inode, dentry);
9eaef27b36a6b7 Trond Myklebust 2006-10-21 1793 if (res != NULL) {
9eaef27b36a6b7 Trond Myklebust 2006-10-21 1794 if (IS_ERR(res))
38f3262acfdb16 Anna Schumaker 2021-09-09 1795 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1796 dentry = res;
9eaef27b36a6b7 Trond Myklebust 2006-10-21 1797 }
a1147b8281bda9 Trond Myklebust 2020-02-05 1798 nfs_set_verifier(dentry, dir_verifier);
^1da177e4c3f41 Linus Torvalds 2005-04-16 1799 out:
38f3262acfdb16 Anna Schumaker 2021-09-09 1800 trace_nfs_lookup_exit(dir, dentry,
flags, error);
e1fb4d05d5a326 Trond Myklebust 2010-04-16 1801 nfs_free_fattr(fattr);
e1fb4d05d5a326 Trond Myklebust 2010-04-16 1802 nfs_free_fhandle(fhandle);
^1da177e4c3f41 Linus Torvalds 2005-04-16 1803 return res;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1804 }
ddda8e0aa8b955 Bryan Schumaker 2012-07-30 1805 EXPORT_SYMBOL_GPL(nfs_lookup);
^1da177e4c3f41 Linus Torvalds 2005-04-16 1806
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org