llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jeff Layton <jlayton@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [jlayton:kdevops 28/32] fs/nfs/nfs4proc.c:4478:7: warning: variable 'op' is uninitialized when used here
Date: Wed, 13 Mar 2024 17:50:35 +0800	[thread overview]
Message-ID: <202403131738.6MRAVx51-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git kdevops
head:   244db11a7d6835249946adae4255d53cb0edf7f6
commit: 794e11b83f62df1c9e75c3411254f60df074a261 [28/32] nfs: try to get a dir delegation with every lookup
config: riscv-defconfig (https://download.01.org/0day-ci/archive/20240313/202403131738.6MRAVx51-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 503c55e17037436dcd45ac69dea8967e67e3f5e8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240313/202403131738.6MRAVx51-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202403131738.6MRAVx51-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from fs/nfs/nfs4proc.c:38:
   In file included from include/linux/mm.h:2188:
   include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     522 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> fs/nfs/nfs4proc.c:4478:7: warning: variable 'op' is uninitialized when used here [-Wuninitialized]
    4478 |                 if (op == NFSPROC4_CLNT_GDD_LOOKUP && res.nf_status == GDD4_OK)
         |                     ^~
   fs/nfs/nfs4proc.c:4437:16: note: initialize the variable 'op' to silence this warning
    4437 |         int status, op;
         |                       ^
         |                        = 0
   fs/nfs/nfs4proc.c:9331:12: warning: variable 'ptr' set but not used [-Wunused-but-set-variable]
    9331 |         unsigned *ptr;
         |                   ^
   3 warnings generated.


vim +/op +4478 fs/nfs/nfs4proc.c

  4431	
  4432	static int _nfs4_proc_lookup(struct rpc_clnt *clnt, struct inode *dir,
  4433			struct dentry *dentry, struct nfs_fh *fhandle,
  4434			struct nfs_fattr *fattr)
  4435	{
  4436		struct nfs_server *server = NFS_SERVER(dir);
  4437		int status, op;
  4438	
  4439		struct nfs4_lookup_arg args = {
  4440			.bitmask = server->attr_bitmask,
  4441			.dir_fh = NFS_FH(dir),
  4442			.name = &dentry->d_name,
  4443		};
  4444		struct nfs4_lookup_res res = {
  4445			.server = server,
  4446			.fattr = fattr,
  4447			.fh = fhandle,
  4448		};
  4449		struct rpc_message msg = {
  4450			.rpc_argp = &args,
  4451			.rpc_resp = &res,
  4452		};
  4453		unsigned short task_flags = 0;
  4454	
  4455		if (nfs_server_capable(dir, NFS_CAP_MOVEABLE))
  4456			task_flags = RPC_TASK_MOVEABLE;
  4457	
  4458		/* Is this is an attribute revalidation, subject to softreval? */
  4459		if (nfs_lookup_is_soft_revalidate(dentry))
  4460			task_flags |= RPC_TASK_TIMEOUT;
  4461		args.bitmask = nfs4_bitmask(server, fattr->label);
  4462	
  4463		nfs_fattr_init(fattr);
  4464		dprintk("NFS call  lookup %pd2\n", dentry);
  4465	retry:
  4466		if (nfs_server_capable(dir, NFS_CAP_GET_DIR_DELEG) &&
  4467		    !rcu_access_pointer(NFS_I(dir)->delegation))
  4468			msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_GDD_LOOKUP];
  4469		else
  4470			msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LOOKUP];
  4471	
  4472		nfs4_init_sequence(&args.seq_args, &res.seq_res, 0, 0);
  4473		status = nfs4_do_call_sync(clnt, server, &msg,
  4474				&args.seq_args, &res.seq_res, task_flags);
  4475	
  4476		switch (status) {
  4477		case 0:
> 4478			if (op == NFSPROC4_CLNT_GDD_LOOKUP && res.nf_status == GDD4_OK)
  4479				status = nfs_inode_set_delegation(dir, current_cred(), FMODE_READ,
  4480								  &res.deleg, 0);
  4481			break;
  4482		case -ENOTSUPP:
  4483			/* If the server doesn't support GET_DIR_DELEGATION, retry without it */
  4484			if (op == NFSPROC4_CLNT_GDD_LOOKUP) {
  4485				server->caps &= ~NFS_CAP_GET_DIR_DELEG;
  4486				goto retry;
  4487			}
  4488		}
  4489		dprintk("NFS reply lookup: %d\n", status);
  4490		return status;
  4491	}
  4492	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2024-03-13  9:50 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=202403131738.6MRAVx51-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jlayton@kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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).