Content-Type: multipart/mixed; boundary="===============6390205163952588467==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: Re: [RFC 11/12] io_uring: sendzc with fixed buffers Date: Wed, 01 Dec 2021 17:18:58 +0800 Message-ID: <202112011718.UpQScm5i-lkp@intel.com> In-Reply-To: <962f2f1c524d25356cdda188070d8653ee28f012.1638282789.git.asml.silence@gmail.com> List-Id: --===============6390205163952588467== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Pavel, [FYI, it's a private test report for your RFC patch.] [auto build test WARNING on next-20211130] [cannot apply to net/master horms-ipvs/master net-next/master linus/master = v5.16-rc3 v5.16-rc2 v5.16-rc1] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Pavel-Begunkov/io_uring-ze= rocopy-send/20211130-232227 base: 34f255a1e91ab44ff8926cf8294ff9144e62e861 config: i386-randconfig-s001-20211129 (https://download.01.org/0day-ci/arch= ive/20211201/202112011718.UpQScm5i-lkp(a)intel.com/config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.4-dirty # https://github.com/0day-ci/linux/commit/6144f7bc14ecc2532d2b7dc22= 1b644bce73f3464 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Pavel-Begunkov/io_uring-zerocopy-s= end/20211130-232227 git checkout 6144f7bc14ecc2532d2b7dc221b644bce73f3464 # save the config file to linux build tree make W=3D1 C=3D1 CF=3D'-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=3D= build_dir ARCH=3Di386 SHELL=3D/bin/bash If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) fs/io_uring.c: note: in included file (through include/trace/trace_event= s.h, include/trace/define_trace.h, include/trace/events/io_uring.h): include/trace/events/io_uring.h:509: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:509:1: sparse: expected unsigned int= [usertype] op_flags include/trace/events/io_uring.h:509:1: sparse: got restricted __kern= el_rwf_t const [usertype] rw_flags fs/io_uring.c: note: in included file (through include/trace/perf.h, inc= lude/trace/define_trace.h, include/trace/events/io_uring.h): include/trace/events/io_uring.h:509: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:509:1: sparse: expected unsigned int= [usertype] op_flags include/trace/events/io_uring.h:509:1: sparse: got restricted __kern= el_rwf_t const [usertype] rw_flags fs/io_uring.c:3286:24: sparse: sparse: incorrect type in return expressi= on (different address spaces) @@ expected void [noderef] __user * @@ = got struct io_buffer *[assigned] kbuf @@ fs/io_uring.c:3286:24: sparse: expected void [noderef] __user * fs/io_uring.c:3286:24: sparse: got struct io_buffer *[assigned] kbuf fs/io_uring.c:4831:14: sparse: sparse: incorrect type in assignment (dif= ferent address spaces) @@ expected struct file *file @@ got struct = file [noderef] __rcu * @@ fs/io_uring.c:4831:14: sparse: expected struct file *file fs/io_uring.c:4831:14: sparse: got struct file [noderef] __rcu * >> fs/io_uring.c:5108:42: sparse: sparse: cast removes address space '__use= r' of expression fs/io_uring.c:5584:72: sparse: sparse: incorrect type in argument 4 (dif= ferent base types) @@ expected int mask @@ got restricted __poll_t = [usertype] mask @@ fs/io_uring.c:5584:72: sparse: expected int mask fs/io_uring.c:5584:72: sparse: got restricted __poll_t [usertype] ma= sk fs/io_uring.c:5588:21: sparse: sparse: incorrect type in assignment (dif= ferent base types) @@ expected unsigned int [usertype] result @@ go= t restricted __poll_t [usertype] mask @@ fs/io_uring.c:5588:21: sparse: expected unsigned int [usertype] resu= lt fs/io_uring.c:5588:21: sparse: got restricted __poll_t [usertype] ma= sk fs/io_uring.c:5613:29: sparse: sparse: incorrect type in assignment (dif= ferent base types) @@ expected unsigned int [usertype] result @@ go= t restricted __poll_t @@ fs/io_uring.c:5613:29: sparse: expected unsigned int [usertype] resu= lt fs/io_uring.c:5613:29: sparse: got restricted __poll_t fs/io_uring.c:5698:51: sparse: sparse: incorrect type in argument 2 (dif= ferent base types) @@ expected restricted __poll_t [usertype] mask @@ = got unsigned int [usertype] result @@ fs/io_uring.c:5698:51: sparse: expected restricted __poll_t [usertyp= e] mask fs/io_uring.c:5698:51: sparse: got unsigned int [usertype] result fs/io_uring.c:5859:41: sparse: sparse: incorrect type in argument 4 (dif= ferent base types) @@ expected int mask @@ got restricted __poll_t = [usertype] @@ fs/io_uring.c:5859:41: sparse: expected int mask fs/io_uring.c:5859:41: sparse: got restricted __poll_t [usertype] fs/io_uring.c:5931:30: sparse: sparse: restricted __poll_t degrades to i= nteger fs/io_uring.c:5931:53: sparse: sparse: incorrect type in initializer (di= fferent base types) @@ expected restricted __poll_t [usertype] mask @@ = got unsigned int @@ fs/io_uring.c:5931:53: sparse: expected restricted __poll_t [usertyp= e] mask fs/io_uring.c:5931:53: sparse: got unsigned int fs/io_uring.c:5939:22: sparse: sparse: invalid assignment: |=3D fs/io_uring.c:5939:22: sparse: left side has type restricted __poll_t fs/io_uring.c:5939:22: sparse: right side has type int fs/io_uring.c:5944:30: sparse: sparse: invalid assignment: &=3D fs/io_uring.c:5944:30: sparse: left side has type restricted __poll_t fs/io_uring.c:5944:30: sparse: right side has type int fs/io_uring.c:5946:22: sparse: sparse: invalid assignment: |=3D fs/io_uring.c:5946:22: sparse: left side has type restricted __poll_t fs/io_uring.c:5946:22: sparse: right side has type int fs/io_uring.c:5965:33: sparse: sparse: incorrect type in argument 5 (dif= ferent base types) @@ expected int mask @@ got restricted __poll_t = [usertype] mask @@ fs/io_uring.c:5965:33: sparse: expected int mask fs/io_uring.c:5965:33: sparse: got restricted __poll_t [usertype] ma= sk fs/io_uring.c:5965:50: sparse: sparse: incorrect type in argument 6 (dif= ferent base types) @@ expected int events @@ got restricted __poll_= t [usertype] events @@ fs/io_uring.c:5965:50: sparse: expected int events fs/io_uring.c:5965:50: sparse: got restricted __poll_t [usertype] ev= ents fs/io_uring.c:6077:24: sparse: sparse: invalid assignment: |=3D fs/io_uring.c:6077:24: sparse: left side has type unsigned int fs/io_uring.c:6077:24: sparse: right side has type restricted __poll_t fs/io_uring.c:6078:65: sparse: sparse: restricted __poll_t degrades to i= nteger fs/io_uring.c:6078:29: sparse: sparse: restricted __poll_t degrades to i= nteger fs/io_uring.c:6078:38: sparse: sparse: incorrect type in return expressi= on (different base types) @@ expected restricted __poll_t @@ got un= signed int @@ fs/io_uring.c:6078:38: sparse: expected restricted __poll_t fs/io_uring.c:6078:38: sparse: got unsigned int fs/io_uring.c:6220:35: sparse: sparse: invalid assignment: &=3D fs/io_uring.c:6220:35: sparse: left side has type restricted __poll_t fs/io_uring.c:6220:35: sparse: right side has type int fs/io_uring.c:6221:54: sparse: sparse: restricted __poll_t degrades to i= nteger fs/io_uring.c:6221:35: sparse: sparse: invalid assignment: |=3D fs/io_uring.c:6221:35: sparse: left side has type restricted __poll_t fs/io_uring.c:6221:35: sparse: right side has type unsigned int fs/io_uring.c:8267:9: sparse: sparse: context imbalance in 'io_sq_thread= _unpark' - wrong count at exit fs/io_uring.c:8278:9: sparse: sparse: context imbalance in 'io_sq_thread= _park' - wrong count at exit vim +/__user +5108 fs/io_uring.c 5089 = 5090 static int io_sendzc(struct io_kiocb *req, unsigned int issue_flags) 5091 { 5092 struct sockaddr_storage address; 5093 struct io_ring_ctx *ctx =3D req->ctx; 5094 struct io_tx_notifier *notifier; 5095 struct io_sendzc *sr =3D &req->msgzc; 5096 struct msghdr msg; 5097 struct iovec iov; 5098 struct socket *sock; 5099 unsigned flags; 5100 int ret, min_ret =3D 0; 5101 = 5102 sock =3D sock_from_file(req->file); 5103 if (unlikely(!sock)) 5104 return -ENOTSOCK; 5105 = 5106 if (req->msgzc.zc_flags & IORING_SENDZC_FIXED_BUF) { 5107 ret =3D __io_import_fixed(WRITE, &msg.msg_iter, req->imu, > 5108 (u64)sr->buf, sr->len); 5109 } else { 5110 ret =3D import_single_range(WRITE, sr->buf, sr->len, &iov, 5111 &msg.msg_iter); 5112 } 5113 if (unlikely(ret)) 5114 return ret; 5115 = 5116 msg.msg_name =3D NULL; 5117 msg.msg_control =3D NULL; 5118 msg.msg_controllen =3D 0; 5119 msg.msg_namelen =3D 0; 5120 if (sr->addr) { 5121 ret =3D move_addr_to_kernel(sr->addr, sr->addr_len, &address); 5122 if (ret < 0) 5123 return ret; 5124 msg.msg_name =3D (struct sockaddr *)&address; 5125 msg.msg_namelen =3D sr->addr_len; 5126 } 5127 = 5128 io_ring_submit_lock(ctx, issue_flags & IO_URING_F_UNLOCKED); 5129 notifier =3D io_get_tx_notifier(ctx, req->msgzc.tx_ctx); 5130 if (!notifier) { 5131 req_set_fail(req); 5132 ret =3D -ENOMEM; 5133 goto out; 5134 } 5135 msg.msg_ubuf =3D ¬ifier->uarg; 5136 = 5137 flags =3D sr->msg_flags; 5138 if (issue_flags & IO_URING_F_NONBLOCK) 5139 flags |=3D MSG_DONTWAIT; 5140 if (flags & MSG_WAITALL) 5141 min_ret =3D iov_iter_count(&msg.msg_iter); 5142 msg.msg_flags =3D flags; 5143 ret =3D sock_sendmsg(sock, &msg); 5144 = 5145 if (ret < min_ret) { 5146 if (ret =3D=3D -EAGAIN && (issue_flags & IO_URING_F_NONBLOCK)) 5147 goto out; 5148 if (ret =3D=3D -ERESTARTSYS) 5149 ret =3D -EINTR; 5150 req_set_fail(req); 5151 } else if (req->msgzc.zc_flags & IORING_SENDZC_FLUSH) { 5152 io_tx_kill_notification(req->msgzc.tx_ctx); 5153 } 5154 io_ring_submit_unlock(ctx, issue_flags & IO_URING_F_UNLOCKED); 5155 __io_req_complete(req, issue_flags, ret, 0); 5156 return 0; 5157 out: 5158 io_ring_submit_unlock(ctx, issue_flags & IO_URING_F_UNLOCKED); 5159 return ret; 5160 } 5161 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============6390205163952588467==--