tree:
https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
for-5.12/io_uring
head: ddebaa7f62a202b40378a5a71d1a51737277d773
commit: 21e779401a16d6f6ca4b5570cdd9b19a29d68bab [29/34] io_uring: get rid of intermediate
IORING_OP_CLOSE stage
config: x86_64-randconfig-s022-20210120 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-208-g46a52ca4-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.12/io_uring
git checkout 21e779401a16d6f6ca4b5570cdd9b19a29d68bab
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
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:3119: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:3119:24: sparse: expected void [noderef] __user *
fs/io_uring.c:3119:24: sparse: got struct io_buffer *[assigned] kbuf
> fs/io_uring.c:4498:14: sparse: sparse: incorrect type in
assignment (different address spaces) @@ expected struct file *file @@ got struct
file [noderef] __rcu * @@
fs/io_uring.c:4498:14: sparse: expected struct file
*file
fs/io_uring.c:4498:14: sparse: got struct file [noderef] __rcu *
fs/io_uring.c:5133:72: sparse: sparse: incorrect type in argument 4 (different base
types) @@ expected int mask @@ got restricted __poll_t [usertype] mask @@
fs/io_uring.c:5133:72: sparse: expected int mask
fs/io_uring.c:5133:72: sparse: got restricted __poll_t [usertype] mask
fs/io_uring.c:5137: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:5137:21: sparse: expected unsigned int [usertype] result
fs/io_uring.c:5137:21: sparse: got restricted __poll_t [usertype] mask
fs/io_uring.c:5163:29: sparse: sparse: incorrect type in assignment (different base
types) @@ expected unsigned int [usertype] result @@ got restricted __poll_t @@
fs/io_uring.c:5163:29: sparse: expected unsigned int [usertype] result
fs/io_uring.c:5163:29: sparse: got restricted __poll_t
fs/io_uring.c:5228:42: 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:5228:42: sparse: expected restricted __poll_t [usertype] mask
fs/io_uring.c:5228:42: sparse: got unsigned int [usertype] result
fs/io_uring.c:5369:41: sparse: sparse: incorrect type in argument 4 (different base
types) @@ expected int mask @@ got restricted __poll_t [usertype] @@
fs/io_uring.c:5369:41: sparse: expected int mask
fs/io_uring.c:5369:41: sparse: got restricted __poll_t [usertype]
fs/io_uring.c:5457:22: sparse: sparse: invalid assignment: |=
fs/io_uring.c:5457:22: sparse: left side has type restricted __poll_t
fs/io_uring.c:5457:22: sparse: right side has type int
fs/io_uring.c:5459:22: sparse: sparse: invalid assignment: |=
fs/io_uring.c:5459:22: sparse: left side has type restricted __poll_t
fs/io_uring.c:5459:22: sparse: right side has type int
fs/io_uring.c:5464:22: sparse: sparse: invalid assignment: &=
fs/io_uring.c:5464:22: sparse: left side has type restricted __poll_t
fs/io_uring.c:5464:22: sparse: right side has type int
fs/io_uring.c:5466:14: sparse: sparse: invalid assignment: |=
fs/io_uring.c:5466:14: sparse: left side has type restricted __poll_t
fs/io_uring.c:5466:14: sparse: right side has type int
fs/io_uring.c:5480: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:5480:67: sparse: expected int mask
fs/io_uring.c:5480:67: sparse: got restricted __poll_t [assigned] [usertype] mask
fs/io_uring.c:5481:52: sparse: sparse: incorrect type in argument 5 (different base
types) @@ expected int events @@ got restricted __poll_t [usertype] events @@
fs/io_uring.c:5481:52: sparse: expected int events
fs/io_uring.c:5481:52: sparse: got restricted __poll_t [usertype] events
fs/io_uring.c:5640:34: sparse: sparse: restricted __poll_t degrades to integer
fs/io_uring.c:5639:57: sparse: sparse: restricted __poll_t degrades to integer
fs/io_uring.c:5639:22: sparse: sparse: incorrect type in assignment (different base
types) @@ expected restricted __poll_t [usertype] events @@ got unsigned int @@
fs/io_uring.c:5639:22: sparse: expected restricted __poll_t [usertype] events
fs/io_uring.c:5639:22: sparse: got unsigned int
fs/io_uring.c:7080:43: sparse: sparse: incompatible types in comparison expression
(different address spaces):
fs/io_uring.c:7080:43: sparse: struct cred const [noderef] __rcu *
fs/io_uring.c:7080:43: sparse: struct cred const *
fs/io_uring.c:7485:13: sparse: sparse: context imbalance in
'io_sq_thread_unpark' - wrong count at exit
fs/io_uring.c:7494:13: sparse: sparse: context imbalance in 'io_sq_thread_park'
- wrong count at exit
fs/io_uring.c:7529:17: sparse: sparse: context imbalance in 'io_sq_thread_stop'
- different lock contexts for basic block
fs/io_uring.c:9031:9: sparse: sparse: context imbalance in
'io_uring_cancel_task_requests' - different lock contexts for basic block
vim +4498 fs/io_uring.c
4481
4482 static int io_close(struct io_kiocb *req, bool force_nonblock,
4483 struct io_comp_state *cs)
4484 {
4485 struct files_struct *files = current->files;
4486 struct io_close *close = &req->close;
4487 struct fdtable *fdt;
4488 struct file *file;
4489 int ret;
4490
4491 ret = -EBADF;
4492 spin_lock(&files->file_lock);
4493 fdt = files_fdtable(files);
4494 if (close->fd >= fdt->max_fds) {
4495 spin_unlock(&files->file_lock);
4496 goto err;
4497 }
4498 file = fdt->fd[close->fd];
4499 if (!file) {
4500 spin_unlock(&files->file_lock);
4501 goto err;
4502 }
4503
4504 /* if the file has a flush method, be safe and punt to async */
4505 if (file->f_op->flush && force_nonblock) {
4506 spin_unlock(&files->file_lock);
4507 return -EAGAIN;
4508 }
4509
4510 ret = __close_fd_get_file(close->fd, &file);
4511 spin_unlock(&files->file_lock);
4512 if (ret < 0) {
4513 if (ret == -ENOENT)
4514 ret = -EBADF;
4515 goto err;
4516 }
4517
4518 /* No ->flush() or already async, safely close from here */
4519 ret = filp_close(file, current->files);
4520 err:
4521 if (ret < 0)
4522 req_set_fail_links(req);
4523 fput(file);
4524 __io_req_complete(req, ret, 0, cs);
4525 return 0;
4526 }
4527
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org