All of lore.kernel.org
 help / color / mirror / Atom feed
* [amir73il:user_path_file 2/2] fs/overlayfs/file.c:51:69: warning: passing argument 1 of 'file_user_cred' discards 'const' qualifier from pointer target type
@ 2026-01-09  9:06 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-01-09  9:06 UTC (permalink / raw)
  To: Amir Goldstein; +Cc: oe-kbuild-all

tree:   https://github.com/amir73il/linux user_path_file
head:   e01a54da66bb15db70e9c68e9c4fcfd458fab424
commit: e01a54da66bb15db70e9c68e9c4fcfd458fab424 [2/2] backing_file: store user_path_file
config: x86_64-rhel-9.4-ltp (https://download.01.org/0day-ci/archive/20260109/202601091014.yhnPpyCU-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260109/202601091014.yhnPpyCU-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/202601091014.yhnPpyCU-lkp@intel.com/

All warnings (new ones prefixed by >>):

   fs/overlayfs/file.c: In function 'ovl_open_realfile':
>> fs/overlayfs/file.c:51:69: warning: passing argument 1 of 'file_user_cred' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
      51 |                                                      file_user_cred(file),
         |                                                                     ^~~~
   In file included from fs/overlayfs/file.c:14:
   include/linux/backing-file.h:32:62: note: expected 'struct file *' but argument is of type 'const struct file *'
      32 | static inline const struct cred *file_user_cred(struct file *f)
         |                                                 ~~~~~~~~~~~~~^


vim +51 fs/overlayfs/file.c

    26	
    27	static struct file *ovl_open_realfile(const struct file *file,
    28					      const struct path *realpath)
    29	{
    30		struct inode *realinode = d_inode(realpath->dentry);
    31		struct inode *inode = file_inode(file);
    32		struct mnt_idmap *real_idmap;
    33		struct file *realfile;
    34		int flags = file->f_flags | OVL_OPEN_FLAGS;
    35		int acc_mode = ACC_MODE(flags);
    36		int err;
    37	
    38		if (flags & O_APPEND)
    39			acc_mode |= MAY_APPEND;
    40	
    41		with_ovl_creds(inode->i_sb) {
    42			real_idmap = mnt_idmap(realpath->mnt);
    43			err = inode_permission(real_idmap, realinode, MAY_OPEN | acc_mode);
    44			if (err) {
    45				realfile = ERR_PTR(err);
    46			} else {
    47				if (!inode_owner_or_capable(real_idmap, realinode))
    48					flags &= ~O_NOATIME;
    49	
    50				realfile = backing_file_open(file_user_path(file),
  > 51							     file_user_cred(file),
    52							     flags, realpath, current_cred());
    53			}
    54		}
    55	
    56		pr_debug("open(%p[%pD2/%c], 0%o) -> (%p, 0%o)\n",
    57			 file, file, ovl_whatisit(inode, realinode), file->f_flags,
    58			 realfile, IS_ERR(realfile) ? 0 : realfile->f_flags);
    59	
    60		return realfile;
    61	}
    62	

-- 
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:[~2026-01-09  9:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-09  9:06 [amir73il:user_path_file 2/2] fs/overlayfs/file.c:51:69: warning: passing argument 1 of 'file_user_cred' discards 'const' qualifier from pointer target type 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.