All of lore.kernel.org
 help / color / mirror / Atom feed
* [brauner-github:work.ovl.cred.guard 34/46] fs/overlayfs/xattrs.c:49 ovl_xattr_set() error: uninitialized symbol 'err'.
@ 2025-11-14 12:47 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-11-14 12:47 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: Christian Brauner <christianvanbrauner@gmail.com>
TO: Christian Brauner <brauner@kernel.org>

tree:   https://github.com/brauner/linux.git work.ovl.cred.guard
head:   74fa97e66e24a79a77ee469a7e8305f2013edd1f
commit: 14be61f717bbc8010dde602fbba948b912d95e38 [34/46] ovl: port ovl_xattr_set() to cred guard
:::::: branch date: 16 hours ago
:::::: commit date: 25 hours ago
config: parisc-randconfig-r072-20251114 (https://download.01.org/0day-ci/archive/20251114/202511142005.dn4tpBG5-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 11.5.0

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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202511142005.dn4tpBG5-lkp@intel.com/

smatch warnings:
fs/overlayfs/xattrs.c:49 ovl_xattr_set() error: uninitialized symbol 'err'.

vim +/err +49 fs/overlayfs/xattrs.c

dad02fad84cbce3 Alexander Larsson 2023-08-15  35  
420a62dde6ebca7 Amir Goldstein    2023-10-10  36  static int ovl_xattr_set(struct dentry *dentry, struct inode *inode, const char *name,
420a62dde6ebca7 Amir Goldstein    2023-10-10  37  			 const void *value, size_t size, int flags)
420a62dde6ebca7 Amir Goldstein    2023-10-10  38  {
420a62dde6ebca7 Amir Goldstein    2023-10-10  39  	int err;
420a62dde6ebca7 Amir Goldstein    2023-10-10  40  	struct ovl_fs *ofs = OVL_FS(dentry->d_sb);
420a62dde6ebca7 Amir Goldstein    2023-10-10  41  	struct dentry *upperdentry = ovl_i_dentry_upper(inode);
420a62dde6ebca7 Amir Goldstein    2023-10-10  42  	struct dentry *realdentry = upperdentry ?: ovl_dentry_lower(dentry);
420a62dde6ebca7 Amir Goldstein    2023-10-10  43  	struct path realpath;
420a62dde6ebca7 Amir Goldstein    2023-10-10  44  
420a62dde6ebca7 Amir Goldstein    2023-10-10  45  	if (!value && !upperdentry) {
420a62dde6ebca7 Amir Goldstein    2023-10-10  46  		ovl_path_lower(dentry, &realpath);
14be61f717bbc80 Christian Brauner 2025-11-12  47  		with_ovl_creds(dentry->d_sb)
420a62dde6ebca7 Amir Goldstein    2023-10-10  48  			err = vfs_getxattr(mnt_idmap(realpath.mnt), realdentry, name, NULL, 0);
420a62dde6ebca7 Amir Goldstein    2023-10-10 @49  		if (err < 0)
420a62dde6ebca7 Amir Goldstein    2023-10-10  50  			goto out;
420a62dde6ebca7 Amir Goldstein    2023-10-10  51  	}
420a62dde6ebca7 Amir Goldstein    2023-10-10  52  
420a62dde6ebca7 Amir Goldstein    2023-10-10  53  	if (!upperdentry) {
420a62dde6ebca7 Amir Goldstein    2023-10-10  54  		err = ovl_copy_up(dentry);
420a62dde6ebca7 Amir Goldstein    2023-10-10  55  		if (err)
420a62dde6ebca7 Amir Goldstein    2023-10-10  56  			goto out;
420a62dde6ebca7 Amir Goldstein    2023-10-10  57  
420a62dde6ebca7 Amir Goldstein    2023-10-10  58  		realdentry = ovl_dentry_upper(dentry);
420a62dde6ebca7 Amir Goldstein    2023-10-10  59  	}
420a62dde6ebca7 Amir Goldstein    2023-10-10  60  
420a62dde6ebca7 Amir Goldstein    2023-10-10  61  	err = ovl_want_write(dentry);
420a62dde6ebca7 Amir Goldstein    2023-10-10  62  	if (err)
420a62dde6ebca7 Amir Goldstein    2023-10-10  63  		goto out;
420a62dde6ebca7 Amir Goldstein    2023-10-10  64  
14be61f717bbc80 Christian Brauner 2025-11-12  65  	with_ovl_creds(dentry->d_sb) {
420a62dde6ebca7 Amir Goldstein    2023-10-10  66  		if (value) {
14be61f717bbc80 Christian Brauner 2025-11-12  67  			err = ovl_do_setxattr(ofs, realdentry, name, value, size, flags);
420a62dde6ebca7 Amir Goldstein    2023-10-10  68  		} else {
420a62dde6ebca7 Amir Goldstein    2023-10-10  69  			WARN_ON(flags != XATTR_REPLACE);
420a62dde6ebca7 Amir Goldstein    2023-10-10  70  			err = ovl_do_removexattr(ofs, realdentry, name);
420a62dde6ebca7 Amir Goldstein    2023-10-10  71  		}
14be61f717bbc80 Christian Brauner 2025-11-12  72  	}
420a62dde6ebca7 Amir Goldstein    2023-10-10  73  	ovl_drop_write(dentry);
420a62dde6ebca7 Amir Goldstein    2023-10-10  74  
420a62dde6ebca7 Amir Goldstein    2023-10-10  75  	/* copy c/mtime */
420a62dde6ebca7 Amir Goldstein    2023-10-10  76  	ovl_copyattr(inode);
420a62dde6ebca7 Amir Goldstein    2023-10-10  77  out:
420a62dde6ebca7 Amir Goldstein    2023-10-10  78  	return err;
420a62dde6ebca7 Amir Goldstein    2023-10-10  79  }
420a62dde6ebca7 Amir Goldstein    2023-10-10  80  

:::::: The code at line 49 was first introduced by commit
:::::: 420a62dde6ebca7bc22e6c57c9cb25d7967ff1ea ovl: Move xattr support to new xattrs.c file

:::::: TO: Amir Goldstein <amir73il@gmail.com>
:::::: CC: Amir Goldstein <amir73il@gmail.com>

-- 
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:[~2025-11-14 12:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-14 12:47 [brauner-github:work.ovl.cred.guard 34/46] fs/overlayfs/xattrs.c:49 ovl_xattr_set() error: uninitialized symbol 'err' kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.