Re: [PATCH v2 3/4] overlay: Add the ability to remount volatile directories when safe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sargun,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on be4df0cea08a8b59eb38d73de988b7ba8022df41]

url:    https://github.com/0day-ci/linux/commits/Sargun-Dhillon/Make-overlayfs-volatile-mounts-reusable/20201127-172416
base:    be4df0cea08a8b59eb38d73de988b7ba8022df41
config: powerpc-randconfig-r034-20201127 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project f095ac11a9550530a4a54298debb8b04b36422be)
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 powerpc cross compiling tool for clang build
        # apt-get install binutils-powerpc-linux-gnu
        # https://github.com/0day-ci/linux/commit/a9871ab1de6c660e6a4c49fcffdb666851003b35
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Sargun-Dhillon/Make-overlayfs-volatile-mounts-reusable/20201127-172416
        git checkout a9871ab1de6c660e6a4c49fcffdb666851003b35
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> fs/overlayfs/readdir.c:1135:6: warning: variable 'd' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           if (!strcmp(p->name, OVL_VOLATILEDIR_NAME)) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/overlayfs/readdir.c:1149:7: note: uninitialized use occurs here
           dput(d);
                ^
   fs/overlayfs/readdir.c:1135:2: note: remove the 'if' if its condition is always true
           if (!strcmp(p->name, OVL_VOLATILEDIR_NAME)) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/overlayfs/readdir.c:1133:18: note: initialize the variable 'd' to silence this warning
           struct dentry *d;
                           ^
                            = NULL
   1 warning generated.

vim +1135 fs/overlayfs/readdir.c

  1122	
  1123	/*
  1124	 * ovl_check_incompat checks this specific incompat entry for incompatibility.
  1125	 * If it is found to be incompatible -EINVAL will be returned.
  1126	 *
  1127	 * If the directory should be preserved, then this function returns 1.
  1128	 */
  1129	static int ovl_check_incompat(struct ovl_fs *ofs, struct ovl_cache_entry *p,
  1130				      struct path *path)
  1131	{
  1132		int err = -EINVAL;
  1133		struct dentry *d;
  1134	
> 1135		if (!strcmp(p->name, OVL_VOLATILEDIR_NAME)) {
  1136			d = lookup_one_len(p->name, path->dentry, p->len);
  1137			if (IS_ERR(d))
  1138				return PTR_ERR(d);
  1139	
  1140			err = ovl_verify_volatile_info(ofs, d);
  1141			dput(d);
  1142		}
  1143	
  1144		if (err == -EINVAL)
  1145			pr_err("incompat feature '%s' cannot be mounted\n", p->name);
  1146		else
  1147			pr_debug("incompat '%s' handled: %d\n", p->name, err);
  1148	
  1149		dput(d);
  1150		return err;
  1151	}
  1152	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux