All of lore.kernel.org
 help / color / mirror / Atom feed
* [amir73il:ovl_real_file 2/4] fs/overlayfs/file.c:139:23: sparse: sparse: Using plain integer as NULL pointer
@ 2024-10-06  0:40 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-10-06  0:40 UTC (permalink / raw)
  To: Amir Goldstein; +Cc: oe-kbuild-all

tree:   https://github.com/amir73il/linux ovl_real_file
head:   2e6c8d603136baf0de510ba069ad78a449012807
commit: e37f0a8ea49c2287a7c722abb1d4d97619bc7271 [2/4] ovl: stash upper real file in backing_file struct
config: hexagon-randconfig-r113-20241005 (https://download.01.org/0day-ci/archive/20241006/202410060829.UTwmlmcr-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project fef3566a25ff0e34fb87339ba5e13eca17cec00f)
reproduce: (https://download.01.org/0day-ci/archive/20241006/202410060829.UTwmlmcr-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/202410060829.UTwmlmcr-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> fs/overlayfs/file.c:139:23: sparse: sparse: Using plain integer as NULL pointer

vim +139 fs/overlayfs/file.c

    93	
    94	static int ovl_real_fdget_meta(const struct file *file, struct fd *real,
    95				       bool upper_meta)
    96	{
    97		struct dentry *dentry = file_dentry(file);
    98		struct file *realfile = file->private_data;
    99		struct file *upperfile = backing_file_private(realfile);
   100		struct path realpath;
   101		int err;
   102	
   103		real->word = 0;
   104	
   105		if (upper_meta) {
   106			ovl_path_upper(dentry, &realpath);
   107			if (!realpath.dentry)
   108				return 0;
   109		} else {
   110			/* lazy lookup and verify of lowerdata */
   111			err = ovl_verify_lowerdata(dentry);
   112			if (err)
   113				return err;
   114	
   115			ovl_path_realdata(dentry, &realpath);
   116		}
   117		if (!realpath.dentry)
   118			return -EIO;
   119	
   120	stashed_upper:
   121		if (upperfile && file_inode(upperfile) == d_inode(realpath.dentry))
   122			realfile = upperfile;
   123	
   124		/*
   125		 * If realfile is lower and has been copied up since we'd opened it,
   126		 * open the real upper file and stash it in backing_file_private().
   127		 */
   128		if (unlikely(file_inode(realfile) != d_inode(realpath.dentry))) {
   129			struct file *old;
   130	
   131			/* Stashed upperfile has a mismatched inode */
   132			if (unlikely(upperfile))
   133				return -EIO;
   134	
   135			upperfile = ovl_open_realfile(file, &realpath);
   136			if (IS_ERR(upperfile))
   137				return PTR_ERR(upperfile);
   138	
 > 139			old = cmpxchg_release(backing_file_private_ptr(realfile), NULL,
   140					      upperfile);
   141			if (old) {
   142				fput(upperfile);
   143				upperfile = old;
   144			}
   145	
   146			goto stashed_upper;
   147		}
   148	
   149		real->word = (unsigned long)realfile;
   150	
   151		/* Did the flags change since open? */
   152		if (unlikely((file->f_flags ^ realfile->f_flags) & ~OVL_OPEN_FLAGS))
   153			return ovl_change_flags(realfile, file->f_flags);
   154	
   155		return 0;
   156	}
   157	

-- 
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-10-06  0:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-06  0:40 [amir73il:ovl_real_file 2/4] fs/overlayfs/file.c:139:23: sparse: sparse: Using plain integer as NULL pointer 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.