tree:
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
queue-5.10
head: 9ced6633127bd25a94939777d9ecda54800859fc
commit: 75a2698c924a9065cc53174004ef4aabfd6eb3c1 [62/74] io_uring: further simplify
do_read error parsing
config: powerpc-randconfig-r002-20210318 (attached as .config)
compiler: clang version 13.0.0 (
https://github.com/llvm/llvm-project
6db3ab2903f42712f44000afb5aa467efbd25f35)
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
#
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/c...
git remote add sashal-linux-stable
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-linux-stable queue-5.10
git checkout 75a2698c924a9065cc53174004ef4aabfd6eb3c1
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
> fs/io_uring.c:3427:8: error: use of undeclared label
'copy_iov'
goto copy_iov;
^
fs/io_uring.c:4275:22: error: use of undeclared identifier
'IO_WQ_WORK_NO_CANCEL'; did you mean 'IO_WQ_WORK_CANCEL'?
req->work.flags |= IO_WQ_WORK_NO_CANCEL;
^~~~~~~~~~~~~~~~~~~~
IO_WQ_WORK_CANCEL
fs/io-wq.h:9:2: note: 'IO_WQ_WORK_CANCEL' declared here
IO_WQ_WORK_CANCEL = 1,
^
fs/io_uring.c:6100:3: error: implicit declaration of function
'io_req_task_work_add_fallback' [-Werror,-Wimplicit-function-declaration]
io_req_task_work_add_fallback(req, io_req_task_cancel);
^
fs/io_uring.c:6100:3: note: did you mean 'io_req_task_work_add'?
fs/io_uring.c:2027:12: note: 'io_req_task_work_add' declared here
static int io_req_task_work_add(struct io_kiocb *req, bool twa_signal_ok)
^
fs/io_uring.c:6101:3: error: non-void function 'io_wq_submit_work' should
return a value [-Wreturn-type]
return;
^
4 errors generated.
vim +/copy_iov +3427 fs/io_uring.c
f67676d160c6ee2 Jens Axboe 2019-12-02 3397
a1d7c393c4711a9 Jens Axboe 2020-06-22 3398 static int io_read(struct io_kiocb *req,
bool force_nonblock,
a1d7c393c4711a9 Jens Axboe 2020-06-22 3399 struct io_comp_state *cs)
2b188cc1bb857a9 Jens Axboe 2019-01-07 3400 {
2b188cc1bb857a9 Jens Axboe 2019-01-07 3401 struct iovec inline_vecs[UIO_FASTIOV],
*iovec = inline_vecs;
9adbd45d6d32ffc Jens Axboe 2019-12-20 3402 struct kiocb *kiocb =
&req->rw.kiocb;
ff6165b2d7f66fc Jens Axboe 2020-08-13 3403 struct iov_iter __iter, *iter =
&__iter;
e8c2bc1fb6c9495 Jens Axboe 2020-08-15 3404 struct io_async_rw *rw =
req->async_data;
227c0c9673d8673 Jens Axboe 2020-08-13 3405 ssize_t io_size, ret, ret2;
f5cac8b156e8b7b Jens Axboe 2020-09-14 3406 bool no_async;
ff6165b2d7f66fc Jens Axboe 2020-08-13 3407
e8c2bc1fb6c9495 Jens Axboe 2020-08-15 3408 if (rw)
e8c2bc1fb6c9495 Jens Axboe 2020-08-15 3409 iter = &rw->iter;
2b188cc1bb857a9 Jens Axboe 2019-01-07 3410
ff6165b2d7f66fc Jens Axboe 2020-08-13 3411 ret = io_import_iovec(READ, req,
&iovec, iter, !force_nonblock);
f67676d160c6ee2 Jens Axboe 2019-12-02 3412 if (ret < 0)
2b188cc1bb857a9 Jens Axboe 2019-01-07 3413 return ret;
758adcb5e98092e Pavel Begunkov 2020-11-07 3414 io_size = iov_iter_count(iter);
fa15bafb71fd7a4 Pavel Begunkov 2020-08-01 3415 req->result = io_size;
227c0c9673d8673 Jens Axboe 2020-08-13 3416 ret = 0;
2b188cc1bb857a9 Jens Axboe 2019-01-07 3417
fd6c2e4c063d645 Jens Axboe 2019-12-18 3418 /* Ensure we clear previously set
non-block flag */
fd6c2e4c063d645 Jens Axboe 2019-12-18 3419 if (!force_nonblock)
29de5f6a350778a Jens Axboe 2020-02-20 3420 kiocb->ki_flags &=
~IOCB_NOWAIT;
a88fc400212fc1d Pavel Begunkov 2020-09-30 3421 else
a88fc400212fc1d Pavel Begunkov 2020-09-30 3422 kiocb->ki_flags |= IOCB_NOWAIT;
a88fc400212fc1d Pavel Begunkov 2020-09-30 3423
24c74678634b3cb Pavel Begunkov 2020-06-21 3424 /* If the file doesn't support
async, just async punt */
f5cac8b156e8b7b Jens Axboe 2020-09-14 3425 no_async = force_nonblock &&
!io_file_supports_async(req->file, READ);
f5cac8b156e8b7b Jens Axboe 2020-09-14 3426 if (no_async)
f67676d160c6ee2 Jens Axboe 2019-12-02 @3427 goto copy_iov;
9e645e1105ca60f Jens Axboe 2019-05-10 3428
758adcb5e98092e Pavel Begunkov 2020-11-07 3429 ret = rw_verify_area(READ, req->file,
io_kiocb_ppos(kiocb), io_size);
fa15bafb71fd7a4 Pavel Begunkov 2020-08-01 3430 if (unlikely(ret))
fa15bafb71fd7a4 Pavel Begunkov 2020-08-01 3431 goto out_free;
2b188cc1bb857a9 Jens Axboe 2019-01-07 3432
227c0c9673d8673 Jens Axboe 2020-08-13 3433 ret = io_iter_do_read(req, iter);
32960613b7c3352 Jens Axboe 2019-09-23 3434
d964a45ff1644d5 Pavel Begunkov 2021-02-01 3435 if (ret == -EIOCBQUEUED) {
227c0c9673d8673 Jens Axboe 2020-08-13 3436 ret = 0;
f67676d160c6ee2 Jens Axboe 2019-12-02 3437 goto out_free;
227c0c9673d8673 Jens Axboe 2020-08-13 3438 } else if (ret == -EAGAIN) {
eefdf30f3dcb5c1 Jens Axboe 2020-08-27 3439 /* IOPOLL retry should happen for io-wq
threads */
eefdf30f3dcb5c1 Jens Axboe 2020-08-27 3440 if (!force_nonblock &&
!(req->ctx->flags & IORING_SETUP_IOPOLL))
f91daf565b0e272 Jens Axboe 2020-08-15 3441 goto done;
355afaeb578abac Jens Axboe 2020-09-02 3442 /* no retry on NONBLOCK marked file */
355afaeb578abac Jens Axboe 2020-09-02 3443 if (req->file->f_flags &
O_NONBLOCK)
355afaeb578abac Jens Axboe 2020-09-02 3444 goto done;
842163154b87b01 Jens Axboe 2020-08-24 3445 /* some cases will consume bytes even
on error returns */
758adcb5e98092e Pavel Begunkov 2020-11-07 3446 iov_iter_revert(iter, io_size -
iov_iter_count(iter));
f38c7e3abfba9a9 Jens Axboe 2020-09-25 3447 ret = 0;
75a2698c924a906 Pavel Begunkov 2021-02-04 3448 } else if (ret <= 0 || ret ==
io_size) {
00d23d516e2e790 Jens Axboe 2020-08-25 3449 /* make sure -ERESTARTSYS -> -EINTR
is done */
00d23d516e2e790 Jens Axboe 2020-08-25 3450 goto done;
75a2698c924a906 Pavel Begunkov 2021-02-04 3451 } else {
75a2698c924a906 Pavel Begunkov 2021-02-04 3452 /* we did blocking attempt. no retry.
*/
75a2698c924a906 Pavel Begunkov 2021-02-04 3453 if (!force_nonblock ||
(req->file->f_flags & O_NONBLOCK) ||
75a2698c924a906 Pavel Begunkov 2021-02-04 3454 !(req->flags &
REQ_F_ISREG))
227c0c9673d8673 Jens Axboe 2020-08-13 3455 goto done;
227c0c9673d8673 Jens Axboe 2020-08-13 3456
227c0c9673d8673 Jens Axboe 2020-08-13 3457 io_size -= ret;
75a2698c924a906 Pavel Begunkov 2021-02-04 3458 }
75a2698c924a906 Pavel Begunkov 2021-02-04 3459
227c0c9673d8673 Jens Axboe 2020-08-13 3460 ret2 = io_setup_async_rw(req, iovec,
inline_vecs, iter, true);
227c0c9673d8673 Jens Axboe 2020-08-13 3461 if (ret2) {
227c0c9673d8673 Jens Axboe 2020-08-13 3462 ret = ret2;
227c0c9673d8673 Jens Axboe 2020-08-13 3463 goto out_free;
f67676d160c6ee2 Jens Axboe 2019-12-02 3464 }
f5cac8b156e8b7b Jens Axboe 2020-09-14 3465 if (no_async)
f5cac8b156e8b7b Jens Axboe 2020-09-14 3466 return -EAGAIN;
e8c2bc1fb6c9495 Jens Axboe 2020-08-15 3467 rw = req->async_data;
227c0c9673d8673 Jens Axboe 2020-08-13 3468 /* it's copied and will be cleaned
with ->io */
227c0c9673d8673 Jens Axboe 2020-08-13 3469 iovec = NULL;
227c0c9673d8673 Jens Axboe 2020-08-13 3470 /* now use our persistent iterator, if
we aren't already */
e8c2bc1fb6c9495 Jens Axboe 2020-08-15 3471 iter = &rw->iter;
227c0c9673d8673 Jens Axboe 2020-08-13 3472 retry:
e8c2bc1fb6c9495 Jens Axboe 2020-08-15 3473 rw->bytes_done += ret;
227c0c9673d8673 Jens Axboe 2020-08-13 3474 /* if we can retry, do so with the
callbacks armed */
227c0c9673d8673 Jens Axboe 2020-08-13 3475 if (!io_rw_should_retry(req)) {
bcf5a06304d69a3 Jens Axboe 2020-05-22 3476 kiocb->ki_flags &= ~IOCB_WAITQ;
f67676d160c6ee2 Jens Axboe 2019-12-02 3477 return -EAGAIN;
2b188cc1bb857a9 Jens Axboe 2019-01-07 3478 }
227c0c9673d8673 Jens Axboe 2020-08-13 3479
227c0c9673d8673 Jens Axboe 2020-08-13 3480 /*
227c0c9673d8673 Jens Axboe 2020-08-13 3481 * Now retry read with the IOCB_WAITQ
parts set in the iocb. If we
227c0c9673d8673 Jens Axboe 2020-08-13 3482 * get -EIOCBQUEUED, then we'll get
a notification when the desired
227c0c9673d8673 Jens Axboe 2020-08-13 3483 * page gets unlocked. We can also get a
partial read here, and if we
227c0c9673d8673 Jens Axboe 2020-08-13 3484 * do, then just retry at the new
offset.
227c0c9673d8673 Jens Axboe 2020-08-13 3485 */
227c0c9673d8673 Jens Axboe 2020-08-13 3486 ret = io_iter_do_read(req, iter);
227c0c9673d8673 Jens Axboe 2020-08-13 3487 if (ret == -EIOCBQUEUED) {
227c0c9673d8673 Jens Axboe 2020-08-13 3488 ret = 0;
227c0c9673d8673 Jens Axboe 2020-08-13 3489 goto out_free;
227c0c9673d8673 Jens Axboe 2020-08-13 3490 } else if (ret > 0 && ret
< io_size) {
227c0c9673d8673 Jens Axboe 2020-08-13 3491 /* we got some bytes, but not all.
retry. */
227c0c9673d8673 Jens Axboe 2020-08-13 3492 goto retry;
227c0c9673d8673 Jens Axboe 2020-08-13 3493 }
227c0c9673d8673 Jens Axboe 2020-08-13 3494 done:
227c0c9673d8673 Jens Axboe 2020-08-13 3495 kiocb_done(kiocb, ret, cs);
227c0c9673d8673 Jens Axboe 2020-08-13 3496 ret = 0;
f67676d160c6ee2 Jens Axboe 2019-12-02 3497 out_free:
f261c16861b8295 Pavel Begunkov 2020-08-20 3498 /* it's reportedly faster than
delegating the null check to kfree() */
252917c30f551e8 Pavel Begunkov 2020-07-13 3499 if (iovec)
2b188cc1bb857a9 Jens Axboe 2019-01-07 3500 kfree(iovec);
2b188cc1bb857a9 Jens Axboe 2019-01-07 3501 return ret;
2b188cc1bb857a9 Jens Axboe 2019-01-07 3502 }
2b188cc1bb857a9 Jens Axboe 2019-01-07 3503
:::::: The code at line 3427 was first introduced by commit
:::::: f67676d160c6ee2ed82917fadfed6d29cab8237c io_uring: ensure async punted read/write
requests copy iovec
:::::: TO: Jens Axboe <axboe(a)kernel.dk>
:::::: CC: Jens Axboe <axboe(a)kernel.dk>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org