From: kernel test robot <lkp@intel.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [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
Date: Fri, 09 Jan 2026 10:06:42 +0100 [thread overview]
Message-ID: <202601091014.yhnPpyCU-lkp@intel.com> (raw)
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
reply other threads:[~2026-01-09 9:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202601091014.yhnPpyCU-lkp@intel.com \
--to=lkp@intel.com \
--cc=amir73il@gmail.com \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.