tree:
https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
for-5.13/io_uring
head: f39c8a5b1130fe17db9c66d08aa473d9587543a9
commit: 9d8058926be7008c1dd49a4e5fb33044f17873c1 [110/116] io_uring: split poll and poll
update structures
config: um-randconfig-s032-20210413 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-280-g2cd6d34e-dirty
#
https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/com...
git remote add block
https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
git fetch --no-tags block for-5.13/io_uring
git checkout 9d8058926be7008c1dd49a4e5fb33044f17873c1
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=um
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
fs/io_uring.c:2918:24: sparse: sparse: incorrect type in return expression (different
address spaces) @@ expected void [noderef] __user * @@ got struct io_buffer
*[assigned] kbuf @@
fs/io_uring.c:2918:24: sparse: expected void [noderef] __user *
fs/io_uring.c:2918:24: sparse: got struct io_buffer *[assigned] kbuf
fs/io_uring.c:4219:14: sparse: sparse: incorrect type in assignment (different address
spaces) @@ expected struct file *file @@ got struct file [noderef] __rcu * @@
fs/io_uring.c:4219:14: sparse: expected struct file *file
fs/io_uring.c:4219:14: sparse: got struct file [noderef] __rcu *
fs/io_uring.c:4824:72: sparse: sparse: incorrect type in argument 4 (different base
types) @@ expected int mask @@ got restricted __poll_t [usertype] mask @@
fs/io_uring.c:4824:72: sparse: expected int mask
fs/io_uring.c:4824:72: sparse: got restricted __poll_t [usertype] mask
fs/io_uring.c:4828:21: sparse: sparse: incorrect type in assignment (different base
types) @@ expected unsigned int [usertype] result @@ got restricted __poll_t
[usertype] mask @@
fs/io_uring.c:4828:21: sparse: expected unsigned int [usertype] result
fs/io_uring.c:4828:21: sparse: got restricted __poll_t [usertype] mask
fs/io_uring.c:4853:29: sparse: sparse: incorrect type in assignment (different base
types) @@ expected unsigned int [usertype] result @@ got restricted __poll_t @@
fs/io_uring.c:4853:29: sparse: expected unsigned int [usertype] result
fs/io_uring.c:4853:29: sparse: got restricted __poll_t
fs/io_uring.c:4934:49: sparse: sparse: incorrect type in argument 2 (different base
types) @@ expected restricted __poll_t [usertype] mask @@ got unsigned int
[usertype] result @@
fs/io_uring.c:4934:49: sparse: expected restricted __poll_t [usertype] mask
fs/io_uring.c:4934:49: sparse: got unsigned int [usertype] result
fs/io_uring.c:5083:41: sparse: sparse: incorrect type in argument 4 (different base
types) @@ expected int mask @@ got restricted __poll_t [usertype] @@
fs/io_uring.c:5083:41: sparse: expected int mask
fs/io_uring.c:5083:41: sparse: got restricted __poll_t [usertype]
fs/io_uring.c:5171:22: sparse: sparse: invalid assignment: |=
fs/io_uring.c:5171:22: sparse: left side has type restricted __poll_t
fs/io_uring.c:5171:22: sparse: right side has type int
fs/io_uring.c:5173:22: sparse: sparse: invalid assignment: |=
fs/io_uring.c:5173:22: sparse: left side has type restricted __poll_t
fs/io_uring.c:5173:22: sparse: right side has type int
fs/io_uring.c:5178:22: sparse: sparse: invalid assignment: &=
fs/io_uring.c:5178:22: sparse: left side has type restricted __poll_t
fs/io_uring.c:5178:22: sparse: right side has type int
fs/io_uring.c:5180:14: sparse: sparse: invalid assignment: |=
fs/io_uring.c:5180:14: sparse: left side has type restricted __poll_t
fs/io_uring.c:5180:14: sparse: right side has type int
fs/io_uring.c:5194:67: sparse: sparse: incorrect type in argument 4 (different base
types) @@ expected int mask @@ got restricted __poll_t [assigned] [usertype] mask
@@
fs/io_uring.c:5194:67: sparse: expected int mask
fs/io_uring.c:5194:67: sparse: got restricted __poll_t [assigned] [usertype] mask
fs/io_uring.c:5195:52: sparse: sparse: incorrect type in argument 5 (different base
types) @@ expected int events @@ got restricted __poll_t [usertype] events @@
fs/io_uring.c:5195:52: sparse: expected int events
fs/io_uring.c:5195:52: sparse: got restricted __poll_t [usertype] events
fs/io_uring.c:5383:24: sparse: sparse: invalid assignment: |=
fs/io_uring.c:5383:24: sparse: left side has type unsigned int
fs/io_uring.c:5383:24: sparse: right side has type restricted __poll_t
fs/io_uring.c:5385:58: sparse: sparse: restricted __poll_t degrades to integer
fs/io_uring.c:5384:31: sparse: sparse: restricted __poll_t degrades to integer
> fs/io_uring.c:5391:34: sparse: sparse: incorrect type in
assignment (different base types) @@ expected restricted __poll_t [usertype] events @@
got unsigned int [assigned] [usertype] events @@
fs/io_uring.c:5391:34:
sparse: expected restricted __poll_t [usertype] events
fs/io_uring.c:5391:34: sparse: got unsigned int [assigned] [usertype] events
fs/io_uring.c:5400:30: sparse: sparse: incorrect type in assignment (different base
types) @@ expected restricted __poll_t [usertype] events @@ got unsigned int
[assigned] [usertype] events @@
fs/io_uring.c:5400:30: sparse: expected restricted __poll_t [usertype] events
fs/io_uring.c:5400:30: sparse: got unsigned int [assigned] [usertype] events
fs/io_uring.c:5472:35: sparse: sparse: invalid assignment: &=
fs/io_uring.c:5472:35: sparse: left side has type restricted __poll_t
fs/io_uring.c:5472:35: sparse: right side has type int
fs/io_uring.c:5473:54: sparse: sparse: restricted __poll_t degrades to integer
fs/io_uring.c:5473:35: sparse: sparse: invalid assignment: |=
fs/io_uring.c:5473:35: sparse: left side has type restricted __poll_t
fs/io_uring.c:5473:35: sparse: right side has type unsigned int
fs/io_uring.c:7233:9: sparse: sparse: context imbalance in
'io_sq_thread_unpark' - wrong count at exit
fs/io_uring.c:7244:9: sparse: sparse: context imbalance in 'io_sq_thread_park'
- wrong count at exit
vim +5391 fs/io_uring.c
5365
5366 static int io_poll_add_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
5367 {
5368 u32 events, flags;
5369
5370 if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL))
5371 return -EINVAL;
5372 if (sqe->ioprio || sqe->buf_index)
5373 return -EINVAL;
5374 flags = READ_ONCE(sqe->len);
5375 if (flags & ~(IORING_POLL_ADD_MULTI | IORING_POLL_UPDATE_EVENTS |
5376 IORING_POLL_UPDATE_USER_DATA))
5377 return -EINVAL;
5378 events = READ_ONCE(sqe->poll32_events);
5379 #ifdef __BIG_ENDIAN
5380 events = swahw32(events);
5381 #endif
5382 if (!(flags & IORING_POLL_ADD_MULTI))
5383 events |= EPOLLONESHOT;
5384 events = demangle_poll(events) |
5385 (events & (EPOLLEXCLUSIVE|EPOLLONESHOT));
5386
5387 if (flags & (IORING_POLL_UPDATE_EVENTS|IORING_POLL_UPDATE_USER_DATA)) {
5388 struct io_poll_update *poll_upd = &req->poll_update;
5389
5390 req->flags |= REQ_F_POLL_UPDATE;
5391 poll_upd->events = events;
5392 poll_upd->old_user_data = READ_ONCE(sqe->addr);
5393 poll_upd->update_events = flags & IORING_POLL_UPDATE_EVENTS;
5394 poll_upd->update_user_data = flags & IORING_POLL_UPDATE_USER_DATA;
5395 if (poll_upd->update_user_data)
5396 poll_upd->new_user_data = READ_ONCE(sqe->off);
5397 } else {
5398 struct io_poll_iocb *poll = &req->poll;
5399
5400 poll->events = events;
5401 if (sqe->off || sqe->addr)
5402 return -EINVAL;
5403 }
5404 return 0;
5405 }
5406
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org