linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: schumaker.anna@gmail.com, Trond.Myklebust@hammerspace.com,
	linux-nfs@vger.kernel.org
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org, Anna.Schumaker@Netapp.com
Subject: Re: [PATCH 05/14] NFS: Remove the label from the nfs4_lookup_res struct
Date: Fri, 10 Sep 2021 10:05:01 +0800	[thread overview]
Message-ID: <202109100915.zYm0oADy-lkp@intel.com> (raw)
In-Reply-To: <20210909201327.108759-6-Anna.Schumaker@Netapp.com>

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

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-up-nfs4_label-allocation/20210910-041620
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/38f3262acfdb163684e4766fa514e85d93c0f507
        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@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

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

  reply	other threads:[~2021-09-10  2:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09 20:13 [PATCH 00/14] Clean up nfs4_label allocation schumaker.anna
2021-09-09 20:13 ` [PATCH 01/14] NFS: Create a new nfs_alloc_fattr_with_label() function schumaker.anna
2021-09-09 20:13 ` [PATCH 02/14] NFS: Remove the nfs4_label from the nfs_entry struct schumaker.anna
2021-09-09 20:13 ` [PATCH 03/14] NFS: Remove the nfs4_label from the nfs4_create_res struct schumaker.anna
2021-09-09 20:13 ` [PATCH 04/14] NFS: Remove the nfs4_label from the nfs4_link_res struct schumaker.anna
2021-09-09 20:13 ` [PATCH 05/14] NFS: Remove the label from the nfs4_lookup_res struct schumaker.anna
2021-09-10  2:05   ` kernel test robot [this message]
2021-09-09 20:13 ` [PATCH 06/14] NFS: Remove the nfs4_label from the nfs4_lookupp_res struct schumaker.anna
2021-09-09 20:13 ` [PATCH 07/14] NFS: Remove the f_label from the nfs4_opendata and nfs_openres schumaker.anna
2021-09-09 20:13 ` [PATCH 08/14] NFS: Remove the nfs4_label from the nfs4_getattr_res schumaker.anna
2021-09-09 20:13 ` [PATCH 09/14] NFS: Remove the nfs4_label from the nfs_setattrres schumaker.anna
2021-09-09 20:13 ` [PATCH 10/14] NFS: Remove the nfs4_label argument from nfs_instantiate() schumaker.anna
2021-09-09 20:13 ` [PATCH 11/14] NFS: Remove the nfs4_label argument from nfs_add_or_obtain() schumaker.anna
2021-09-09 20:13 ` [PATCH 12/14] NFS: Remove the nfs4_label argument from nfs_fhget() schumaker.anna
2021-09-09 20:13 ` [PATCH 13/14] NFS: Remove the nfs4_label argument from nfs_setsecurity schumaker.anna
2021-09-09 20:13 ` [PATCH 14/14] NFS: Remove the nfs4_label argument from decode_getattr_*() functions schumaker.anna

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=202109100915.zYm0oADy-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Anna.Schumaker@Netapp.com \
    --cc=Trond.Myklebust@hammerspace.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=schumaker.anna@gmail.com \
    /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).