All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: kbuild-all@lists.01.org,
	GNU/Weeb Mailing List <gwml@vger.gnuweeb.org>,
	linux-kernel@vger.kernel.org
Subject: [ammarfaizi2-block:axboe/linux-block/for-5.19/io_uring-pbuf 75/84] fs/io_uring.c:3599:23: sparse: sparse: incorrect type in return expression (different address spaces)
Date: Sat, 30 Apr 2022 08:26:52 +0800	[thread overview]
Message-ID: <202204300822.PgmiQykR-lkp@intel.com> (raw)

tree:   https://github.com/ammarfaizi2/linux-block axboe/linux-block/for-5.19/io_uring-pbuf
head:   074a323cc380d98290411884e8eb4c3ca7effb87
commit: d84cb823377d1cd0b056c07f404c69671193e795 [75/84] io_uring: make io_buffer_select() return the user address directly
config: arc-randconfig-s031-20220429 (https://download.01.org/0day-ci/archive/20220430/202204300822.PgmiQykR-lkp@intel.com/config)
compiler: arc-elf-gcc (GCC) 11.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/ammarfaizi2/linux-block/commit/d84cb823377d1cd0b056c07f404c69671193e795
        git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
        git fetch --no-tags ammarfaizi2-block axboe/linux-block/for-5.19/io_uring-pbuf
        git checkout d84cb823377d1cd0b056c07f404c69671193e795
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arc SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
   fs/io_uring.c: note: in included file (through include/trace/trace_events.h, include/trace/define_trace.h, include/trace/events/io_uring.h):
   include/trace/events/io_uring.h:493:1: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] op_flags @@     got restricted __kernel_rwf_t const [usertype] rw_flags @@
   include/trace/events/io_uring.h:493:1: sparse:     expected unsigned int [usertype] op_flags
   include/trace/events/io_uring.h:493:1: sparse:     got restricted __kernel_rwf_t const [usertype] rw_flags
   fs/io_uring.c:3414:23: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] flags @@     got restricted __kernel_rwf_t @@
   fs/io_uring.c:3414:23: sparse:     expected unsigned int [usertype] flags
   fs/io_uring.c:3414:23: sparse:     got restricted __kernel_rwf_t
>> fs/io_uring.c:3599:23: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void [noderef] __user * @@     got void * @@
   fs/io_uring.c:3599:23: sparse:     expected void [noderef] __user *
   fs/io_uring.c:3599:23: sparse:     got void *
   fs/io_uring.c:3991:48: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected restricted __kernel_rwf_t [usertype] flags @@     got unsigned int [usertype] flags @@
   fs/io_uring.c:3991:48: sparse:     expected restricted __kernel_rwf_t [usertype] flags
   fs/io_uring.c:3991:48: sparse:     got unsigned int [usertype] flags
   fs/io_uring.c:5565:14: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct file *file @@     got struct file [noderef] __rcu * @@
   fs/io_uring.c:5565:14: sparse:     expected struct file *file
   fs/io_uring.c:5565:14: sparse:     got struct file [noderef] __rcu *
   fs/io_uring.c:6402:68: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __poll_t [usertype] _key @@     got int apoll_events @@
   fs/io_uring.c:6402:68: sparse:     expected restricted __poll_t [usertype] _key
   fs/io_uring.c:6402:68: sparse:     got int apoll_events
   fs/io_uring.c:6407:48: sparse: sparse: restricted __poll_t degrades to integer
   fs/io_uring.c:6411:59: sparse: sparse: restricted __poll_t degrades to integer
   fs/io_uring.c:6412:66: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected restricted __poll_t [usertype] val @@     got int @@
   fs/io_uring.c:6412:66: sparse:     expected restricted __poll_t [usertype] val
   fs/io_uring.c:6412:66: sparse:     got int
   fs/io_uring.c:6412:52: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __poll_t [usertype] mask @@     got unsigned short @@
   fs/io_uring.c:6412:52: sparse:     expected restricted __poll_t [usertype] mask
   fs/io_uring.c:6412:52: sparse:     got unsigned short
   fs/io_uring.c:6416:75: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected signed int [usertype] res @@     got restricted __poll_t [usertype] mask @@
   fs/io_uring.c:6416:75: sparse:     expected signed int [usertype] res
   fs/io_uring.c:6416:75: sparse:     got restricted __poll_t [usertype] mask
   fs/io_uring.c:6446:68: sparse: sparse: restricted __poll_t degrades to integer
   fs/io_uring.c:6446:57: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected restricted __poll_t [usertype] val @@     got unsigned int @@
   fs/io_uring.c:6446:57: sparse:     expected restricted __poll_t [usertype] val
   fs/io_uring.c:6446:57: sparse:     got unsigned int
   fs/io_uring.c:6527:45: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected int events @@     got restricted __poll_t [usertype] events @@
   fs/io_uring.c:6527:45: sparse:     expected int events
   fs/io_uring.c:6527:45: sparse:     got restricted __poll_t [usertype] events
   fs/io_uring.c:6562:40: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected int mask @@     got restricted __poll_t [usertype] mask @@
   fs/io_uring.c:6562:40: sparse:     expected int mask
   fs/io_uring.c:6562:40: sparse:     got restricted __poll_t [usertype] mask
   fs/io_uring.c:6562:50: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected int events @@     got restricted __poll_t [usertype] events @@
   fs/io_uring.c:6562:50: sparse:     expected int events
   fs/io_uring.c:6562:50: sparse:     got restricted __poll_t [usertype] events
   fs/io_uring.c:6654:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got restricted __poll_t [assigned] [usertype] mask @@
   fs/io_uring.c:6654:24: sparse:     expected int
   fs/io_uring.c:6654:24: sparse:     got restricted __poll_t [assigned] [usertype] mask
   fs/io_uring.c:6671:40: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected int mask @@     got restricted __poll_t [assigned] [usertype] mask @@
   fs/io_uring.c:6671:40: sparse:     expected int mask
   fs/io_uring.c:6671:40: sparse:     got restricted __poll_t [assigned] [usertype] mask
   fs/io_uring.c:6671:50: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected int events @@     got restricted __poll_t [usertype] events @@
   fs/io_uring.c:6671:50: sparse:     expected int events
   fs/io_uring.c:6671:50: sparse:     got restricted __poll_t [usertype] events
   fs/io_uring.c:6681:47: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected int events @@     got restricted __poll_t [usertype] events @@
   fs/io_uring.c:6681:47: sparse:     expected int events
   fs/io_uring.c:6681:47: sparse:     got restricted __poll_t [usertype] events
   fs/io_uring.c:6706:25: sparse: sparse: restricted __poll_t degrades to integer
   fs/io_uring.c:6706:48: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __poll_t [usertype] mask @@     got unsigned int @@
   fs/io_uring.c:6706:48: sparse:     expected restricted __poll_t [usertype] mask
   fs/io_uring.c:6706:48: sparse:     got unsigned int
   fs/io_uring.c:6717:22: sparse: sparse: invalid assignment: |=
   fs/io_uring.c:6717:22: sparse:    left side has type restricted __poll_t
   fs/io_uring.c:6717:22: sparse:    right side has type int
   fs/io_uring.c:6722:30: sparse: sparse: invalid assignment: &=
   fs/io_uring.c:6722:30: sparse:    left side has type restricted __poll_t
   fs/io_uring.c:6722:30: sparse:    right side has type int
   fs/io_uring.c:6724:22: sparse: sparse: invalid assignment: |=
   fs/io_uring.c:6724:22: sparse:    left side has type restricted __poll_t
   fs/io_uring.c:6724:22: sparse:    right side has type int
   fs/io_uring.c:6752:33: sparse: sparse: incorrect type in argument 5 (different base types) @@     expected int mask @@     got restricted __poll_t [assigned] [usertype] mask @@
   fs/io_uring.c:6752:33: sparse:     expected int mask
   fs/io_uring.c:6752:33: sparse:     got restricted __poll_t [assigned] [usertype] mask
   fs/io_uring.c:6752:50: sparse: sparse: incorrect type in argument 6 (different base types) @@     expected int events @@     got restricted __poll_t [usertype] events @@
   fs/io_uring.c:6752:50: sparse:     expected int events
   fs/io_uring.c:6752:50: sparse:     got restricted __poll_t [usertype] events
   fs/io_uring.c:6866:24: sparse: sparse: invalid assignment: |=
   fs/io_uring.c:6866:24: sparse:    left side has type unsigned int
   fs/io_uring.c:6866:24: sparse:    right side has type restricted __poll_t
   fs/io_uring.c:6867:65: sparse: sparse: restricted __poll_t degrades to integer
   fs/io_uring.c:6867:29: sparse: sparse: restricted __poll_t degrades to integer
   fs/io_uring.c:6867:38: sparse: sparse: incorrect type in return expression (different base types) @@     expected restricted __poll_t @@     got unsigned int @@
   fs/io_uring.c:6867:38: sparse:     expected restricted __poll_t
   fs/io_uring.c:6867:38: sparse:     got unsigned int
   fs/io_uring.c:6919:27: sparse: sparse: incorrect type in assignment (different base types) @@     expected int apoll_events @@     got restricted __poll_t [usertype] events @@
   fs/io_uring.c:6919:27: sparse:     expected int apoll_events
   fs/io_uring.c:6919:27: sparse:     got restricted __poll_t [usertype] events
   fs/io_uring.c:6958:43: sparse: sparse: invalid assignment: &=
   fs/io_uring.c:6958:43: sparse:    left side has type restricted __poll_t
   fs/io_uring.c:6958:43: sparse:    right side has type int
   fs/io_uring.c:6959:62: sparse: sparse: restricted __poll_t degrades to integer
   fs/io_uring.c:6959:43: sparse: sparse: invalid assignment: |=
   fs/io_uring.c:6959:43: sparse:    left side has type restricted __poll_t
   fs/io_uring.c:6959:43: sparse:    right side has type unsigned int
   fs/io_uring.c:2663:17: sparse: sparse: context imbalance in 'handle_prev_tw_list' - different lock contexts for basic block
   fs/io_uring.c:8058:39: sparse: sparse: marked inline, but without a definition
   fs/io_uring.c:8058:39: sparse: sparse: marked inline, but without a definition
   fs/io_uring.c:8058:39: sparse: sparse: marked inline, but without a definition
   fs/io_uring.c:8058:39: sparse: sparse: marked inline, but without a definition

vim +3599 fs/io_uring.c

  3573	
  3574	static void __user *io_buffer_select(struct io_kiocb *req, size_t *len,
  3575					     int bgid, unsigned int issue_flags)
  3576	{
  3577		struct io_buffer *kbuf = req->kbuf;
  3578		struct io_ring_ctx *ctx = req->ctx;
  3579		struct io_buffer_list *bl;
  3580	
  3581		if (req->flags & REQ_F_BUFFER_SELECTED)
  3582			return u64_to_user_ptr(kbuf->addr);
  3583	
  3584		io_ring_submit_lock(req->ctx, issue_flags);
  3585	
  3586		bl = io_buffer_get_list(ctx, bgid);
  3587		if (bl && !list_empty(&bl->buf_list)) {
  3588			kbuf = list_first_entry(&bl->buf_list, struct io_buffer, list);
  3589			list_del(&kbuf->list);
  3590			if (*len > kbuf->len)
  3591				*len = kbuf->len;
  3592			req->flags |= REQ_F_BUFFER_SELECTED;
  3593			req->kbuf = kbuf;
  3594			io_ring_submit_unlock(req->ctx, issue_flags);
  3595			return u64_to_user_ptr(kbuf->addr);
  3596		}
  3597	
  3598		io_ring_submit_unlock(req->ctx, issue_flags);
> 3599		return ERR_PTR(-ENOBUFS);
  3600	}
  3601	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

                 reply	other threads:[~2022-04-30  0:30 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=202204300822.PgmiQykR-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=axboe@kernel.dk \
    --cc=gwml@vger.gnuweeb.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    /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.