llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [brauner-github:work.cred 1/27] io_uring/io_uring.c:1707:45: error: passing 'const struct cred *' to parameter of type 'struct cred *' discards qualifiers
@ 2024-11-24 16:36 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-11-24 16:36 UTC (permalink / raw)
  To: Christian Brauner; +Cc: llvm, oe-kbuild-all, Christian Brauner

tree:   https://github.com/brauner/linux.git work.cred
head:   a617a3cb721d5c4fdc88889c7d80936831efe7df
commit: 52ef01ce9c2dafcc67b4657dd2991d097ab2f0a7 [1/27] tree-wide: s/override_creds()/override_creds_light(get_new_cred())/g
config: arm-allnoconfig (https://download.01.org/0day-ci/archive/20241125/202411250024.1IJ2Exmf-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 592c0fe55f6d9a811028b5f3507be91458ab2713)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241125/202411250024.1IJ2Exmf-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/202411250024.1IJ2Exmf-lkp@intel.com/

Note: the brauner-github/work.cred HEAD a617a3cb721d5c4fdc88889c7d80936831efe7df builds fine.
      It only hurts bisectability.

All errors (new ones prefixed by >>):

   In file included from io_uring/io_uring.c:45:
   In file included from include/linux/syscalls.h:94:
   In file included from include/trace/syscall.h:7:
   In file included from include/linux/trace_events.h:6:
   In file included from include/linux/ring_buffer.h:5:
   In file included from include/linux/mm.h:2225:
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> io_uring/io_uring.c:1707:45: error: passing 'const struct cred *' to parameter of type 'struct cred *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    1707 |                 creds = override_creds_light(get_new_cred(req->creds));
         |                                                           ^~~~~~~~~~
   include/linux/cred.h:214:54: note: passing argument to parameter 'cred' here
     214 | static inline struct cred *get_new_cred(struct cred *cred)
         |                                                      ^
   1 warning and 1 error generated.
--
   In file included from io_uring/sqpoll.c:9:
   In file included from include/linux/mm.h:2225:
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> io_uring/sqpoll.c:177:46: error: passing 'const struct cred *' to parameter of type 'struct cred *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
     177 |                         creds = override_creds_light(get_new_cred(ctx->sq_creds));
         |                                                                   ^~~~~~~~~~~~~
   include/linux/cred.h:214:54: note: passing argument to parameter 'cred' here
     214 | static inline struct cred *get_new_cred(struct cred *cred)
         |                                                      ^
   1 warning and 1 error generated.


vim +1707 io_uring/io_uring.c

  1696	
  1697	static int io_issue_sqe(struct io_kiocb *req, unsigned int issue_flags)
  1698	{
  1699		const struct io_issue_def *def = &io_issue_defs[req->opcode];
  1700		const struct cred *creds = NULL;
  1701		int ret;
  1702	
  1703		if (unlikely(!io_assign_file(req, def, issue_flags)))
  1704			return -EBADF;
  1705	
  1706		if (unlikely((req->flags & REQ_F_CREDS) && req->creds != current_cred()))
> 1707			creds = override_creds_light(get_new_cred(req->creds));
  1708	
  1709		if (!def->audit_skip)
  1710			audit_uring_entry(req->opcode);
  1711	
  1712		ret = def->issue(req, issue_flags);
  1713	
  1714		if (!def->audit_skip)
  1715			audit_uring_exit(!ret, ret);
  1716	
  1717		if (creds)
  1718			revert_creds(creds);
  1719	
  1720		if (ret == IOU_OK) {
  1721			if (issue_flags & IO_URING_F_COMPLETE_DEFER)
  1722				io_req_complete_defer(req);
  1723			else
  1724				io_req_complete_post(req, issue_flags);
  1725	
  1726			return 0;
  1727		}
  1728	
  1729		if (ret == IOU_ISSUE_SKIP_COMPLETE) {
  1730			ret = 0;
  1731			io_arm_ltimeout(req);
  1732	
  1733			/* If the op doesn't have a file, we're not polling for it */
  1734			if ((req->ctx->flags & IORING_SETUP_IOPOLL) && def->iopoll_queue)
  1735				io_iopoll_req_issued(req, issue_flags);
  1736		}
  1737		return ret;
  1738	}
  1739	

-- 
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-11-24 16:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-24 16:36 [brauner-github:work.cred 1/27] io_uring/io_uring.c:1707:45: error: passing 'const struct cred *' to parameter of type 'struct cred *' discards qualifiers kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).