public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* Re: [RFC PATCH] NFS: Fix missing files in `ls` command output
       [not found] <20240829091340.2043-1-laoar.shao@gmail.com>
@ 2024-09-01 13:59 ` kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-09-01 13:59 UTC (permalink / raw)
  To: Yafang Shao; +Cc: llvm, oe-kbuild-all

Hi Yafang,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build warnings:

[auto build test WARNING on trondmy-nfs/linux-next]
[also build test WARNING on linus/master v6.11-rc6 next-20240830]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Yafang-Shao/NFS-Fix-missing-files-in-ls-command-output/20240829-171711
base:   git://git.linux-nfs.org/projects/trondmy/linux-nfs.git linux-next
patch link:    https://lore.kernel.org/r/20240829091340.2043-1-laoar.shao%40gmail.com
patch subject: [RFC PATCH] NFS: Fix missing files in `ls` command output
config: i386-randconfig-001-20240901 (https://download.01.org/0day-ci/archive/20240901/202409012146.wYz4Qg5V-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240901/202409012146.wYz4Qg5V-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/202409012146.wYz4Qg5V-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/nfs/dir.c:326:6: warning: variable 'cache_entry' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
     326 |         if (ret) {
         |             ^~~
   fs/nfs/dir.c:345:17: note: uninitialized use occurs here
     345 |         *prev_cookie = cache_entry->cookie;
         |                        ^~~~~~~~~~~
   fs/nfs/dir.c:326:2: note: remove the 'if' if its condition is always false
     326 |         if (ret) {
         |         ^~~~~~~~~~
     327 |                 kfree(name);
         |                 ~~~~~~~~~~~~
     328 |                 goto out;
         |                 ~~~~~~~~~
     329 |         }
         |         ~
   fs/nfs/dir.c:323:6: warning: variable 'cache_entry' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
     323 |         if (!name)
         |             ^~~~~
   fs/nfs/dir.c:345:17: note: uninitialized use occurs here
     345 |         *prev_cookie = cache_entry->cookie;
         |                        ^~~~~~~~~~~
   fs/nfs/dir.c:323:2: note: remove the 'if' if its condition is always false
     323 |         if (!name)
         |         ^~~~~~~~~~
     324 |                 goto out;
         |                 ~~~~~~~~
   fs/nfs/dir.c:316:43: note: initialize the variable 'cache_entry' to silence this warning
     316 |         struct nfs_cache_array_entry *cache_entry;
         |                                                  ^
         |                                                   = NULL
   2 warnings generated.


vim +326 fs/nfs/dir.c

d1bacf9eb2fd0e Bryan Schumaker       2010-09-24  310  
ec108d3cc7663d Anna Schumaker        2023-04-04  311  static int nfs_readdir_folio_array_append(struct folio *folio,
0adf85b445c7fb Trond Myklebust       2022-02-27  312  					  const struct nfs_entry *entry,
b04660a1b4ac01 Yafang Shao           2024-08-29  313  					  u64 *cookie, u64 *prev_cookie)
d1bacf9eb2fd0e Bryan Schumaker       2010-09-24  314  {
a52a8a6adad99e Trond Myklebust       2020-11-01  315  	struct nfs_cache_array *array;
4a201d6e3f4253 Trond Myklebust       2010-10-23  316  	struct nfs_cache_array_entry *cache_entry;
a52a8a6adad99e Trond Myklebust       2020-11-01  317  	const char *name;
0adf85b445c7fb Trond Myklebust       2022-02-27  318  	int ret = -ENOMEM;
4a201d6e3f4253 Trond Myklebust       2010-10-23  319  
a52a8a6adad99e Trond Myklebust       2020-11-01  320  	name = nfs_readdir_copy_name(entry->name, entry->len);
3020093f578fb6 Trond Myklebust       2010-11-20  321  
4b71e2416ec4cb Fabio M. De Francesco 2023-05-03  322  	array = kmap_local_folio(folio, 0);
0adf85b445c7fb Trond Myklebust       2022-02-27  323  	if (!name)
0adf85b445c7fb Trond Myklebust       2022-02-27  324  		goto out;
b1e21c97437f64 Trond Myklebust       2020-11-01  325  	ret = nfs_readdir_array_can_expand(array);
a52a8a6adad99e Trond Myklebust       2020-11-01 @326  	if (ret) {
a52a8a6adad99e Trond Myklebust       2020-11-01  327  		kfree(name);
4a201d6e3f4253 Trond Myklebust       2010-10-23  328  		goto out;
a52a8a6adad99e Trond Myklebust       2020-11-01  329  	}
d1bacf9eb2fd0e Bryan Schumaker       2010-09-24  330  
b1e21c97437f64 Trond Myklebust       2020-11-01  331  	cache_entry = &array->array[array->size];
0adf85b445c7fb Trond Myklebust       2022-02-27  332  	cache_entry->cookie = array->last_cookie;
4a201d6e3f4253 Trond Myklebust       2010-10-23  333  	cache_entry->ino = entry->ino;
0b26a0bf6ff398 Trond Myklebust       2010-11-20  334  	cache_entry->d_type = entry->d_type;
a52a8a6adad99e Trond Myklebust       2020-11-01  335  	cache_entry->name_len = entry->len;
a52a8a6adad99e Trond Myklebust       2020-11-01  336  	cache_entry->name = name;
d1bacf9eb2fd0e Bryan Schumaker       2010-09-24  337  	array->last_cookie = entry->cookie;
762567b7c798af Trond Myklebust       2020-11-04  338  	if (array->last_cookie <= cache_entry->cookie)
762567b7c798af Trond Myklebust       2020-11-04  339  		array->cookies_are_ordered = 0;
8cd51a0ccd1bed Trond Myklebust       2010-11-15  340  	array->size++;
47c716cbf638a1 Trond Myklebust       2010-12-07  341  	if (entry->eof != 0)
b1e21c97437f64 Trond Myklebust       2020-11-01  342  		nfs_readdir_array_set_eof(array);
4a201d6e3f4253 Trond Myklebust       2010-10-23  343  out:
0adf85b445c7fb Trond Myklebust       2022-02-27  344  	*cookie = array->last_cookie;
b04660a1b4ac01 Yafang Shao           2024-08-29  345  	*prev_cookie = cache_entry->cookie;
4b71e2416ec4cb Fabio M. De Francesco 2023-05-03  346  	kunmap_local(array);
4a201d6e3f4253 Trond Myklebust       2010-10-23  347  	return ret;
d1bacf9eb2fd0e Bryan Schumaker       2010-09-24  348  }
d1bacf9eb2fd0e Bryan Schumaker       2010-09-24  349  

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

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

only message in thread, other threads:[~2024-09-01 13:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20240829091340.2043-1-laoar.shao@gmail.com>
2024-09-01 13:59 ` [RFC PATCH] NFS: Fix missing files in `ls` command output 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