tree:
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
queue-5.11
head: 8c3b9b9eb43a7ddb91a2a4c84f0bfa5f118894ae
commit: 93096a0f2ab1b1b801642d7fcd99eb71d98b9e3c [10/22] io_uring: further simplify
do_read error parsing
config: powerpc64-randconfig-r036-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 powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-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.11
git checkout 93096a0f2ab1b1b801642d7fcd99eb71d98b9e3c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64
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:3517:8: error: use of undeclared label
'copy_iov'
goto copy_iov;
^
1 error generated.
vim +/copy_iov +3517 fs/io_uring.c
f67676d160c6ee Jens Axboe 2019-12-02 3485
a1d7c393c4711a Jens Axboe 2020-06-22 3486 static int io_read(struct io_kiocb *req,
bool force_nonblock,
a1d7c393c4711a Jens Axboe 2020-06-22 3487 struct io_comp_state *cs)
2b188cc1bb857a Jens Axboe 2019-01-07 3488 {
2b188cc1bb857a Jens Axboe 2019-01-07 3489 struct iovec inline_vecs[UIO_FASTIOV],
*iovec = inline_vecs;
9adbd45d6d32ff Jens Axboe 2019-12-20 3490 struct kiocb *kiocb =
&req->rw.kiocb;
ff6165b2d7f66f Jens Axboe 2020-08-13 3491 struct iov_iter __iter, *iter =
&__iter;
e8c2bc1fb6c949 Jens Axboe 2020-08-15 3492 struct io_async_rw *rw =
req->async_data;
227c0c9673d867 Jens Axboe 2020-08-13 3493 ssize_t io_size, ret, ret2;
f5cac8b156e8b7 Jens Axboe 2020-09-14 3494 bool no_async;
ff6165b2d7f66f Jens Axboe 2020-08-13 3495
2846c481c9dd1f Pavel Begunkov 2020-11-07 3496 if (rw) {
e8c2bc1fb6c949 Jens Axboe 2020-08-15 3497 iter = &rw->iter;
2846c481c9dd1f Pavel Begunkov 2020-11-07 3498 iovec = NULL;
2846c481c9dd1f Pavel Begunkov 2020-11-07 3499 } else {
ff6165b2d7f66f Jens Axboe 2020-08-13 3500 ret = io_import_iovec(READ, req,
&iovec, iter, !force_nonblock);
f67676d160c6ee Jens Axboe 2019-12-02 3501 if (ret < 0)
2b188cc1bb857a Jens Axboe 2019-01-07 3502 return ret;
2846c481c9dd1f Pavel Begunkov 2020-11-07 3503 }
632546c4b5a4da Pavel Begunkov 2020-11-07 3504 io_size = iov_iter_count(iter);
fa15bafb71fd7a Pavel Begunkov 2020-08-01 3505 req->result = io_size;
227c0c9673d867 Jens Axboe 2020-08-13 3506 ret = 0;
2b188cc1bb857a Jens Axboe 2019-01-07 3507
fd6c2e4c063d64 Jens Axboe 2019-12-18 3508 /* Ensure we clear previously set
non-block flag */
fd6c2e4c063d64 Jens Axboe 2019-12-18 3509 if (!force_nonblock)
29de5f6a350778 Jens Axboe 2020-02-20 3510 kiocb->ki_flags &= ~IOCB_NOWAIT;
a88fc400212fc1 Pavel Begunkov 2020-09-30 3511 else
a88fc400212fc1 Pavel Begunkov 2020-09-30 3512 kiocb->ki_flags |= IOCB_NOWAIT;
a88fc400212fc1 Pavel Begunkov 2020-09-30 3513
24c74678634b3c Pavel Begunkov 2020-06-21 3514 /* If the file doesn't support async,
just async punt */
f5cac8b156e8b7 Jens Axboe 2020-09-14 3515 no_async = force_nonblock &&
!io_file_supports_async(req->file, READ);
f5cac8b156e8b7 Jens Axboe 2020-09-14 3516 if (no_async)
f67676d160c6ee Jens Axboe 2019-12-02 @3517 goto copy_iov;
9e645e1105ca60 Jens Axboe 2019-05-10 3518
632546c4b5a4da Pavel Begunkov 2020-11-07 3519 ret = rw_verify_area(READ, req->file,
io_kiocb_ppos(kiocb), io_size);
fa15bafb71fd7a Pavel Begunkov 2020-08-01 3520 if (unlikely(ret))
fa15bafb71fd7a Pavel Begunkov 2020-08-01 3521 goto out_free;
2b188cc1bb857a Jens Axboe 2019-01-07 3522
227c0c9673d867 Jens Axboe 2020-08-13 3523 ret = io_iter_do_read(req, iter);
32960613b7c335 Jens Axboe 2019-09-23 3524
447313db13e52f Pavel Begunkov 2021-02-01 3525 if (ret == -EIOCBQUEUED) {
227c0c9673d867 Jens Axboe 2020-08-13 3526 ret = 0;
f67676d160c6ee Jens Axboe 2019-12-02 3527 goto out_free;
227c0c9673d867 Jens Axboe 2020-08-13 3528 } else if (ret == -EAGAIN) {
eefdf30f3dcb5c Jens Axboe 2020-08-27 3529 /* IOPOLL retry should happen for io-wq
threads */
eefdf30f3dcb5c Jens Axboe 2020-08-27 3530 if (!force_nonblock &&
!(req->ctx->flags & IORING_SETUP_IOPOLL))
f91daf565b0e27 Jens Axboe 2020-08-15 3531 goto done;
355afaeb578aba Jens Axboe 2020-09-02 3532 /* no retry on NONBLOCK marked file */
355afaeb578aba Jens Axboe 2020-09-02 3533 if (req->file->f_flags &
O_NONBLOCK)
355afaeb578aba Jens Axboe 2020-09-02 3534 goto done;
842163154b87b0 Jens Axboe 2020-08-24 3535 /* some cases will consume bytes even on
error returns */
632546c4b5a4da Pavel Begunkov 2020-11-07 3536 iov_iter_revert(iter, io_size -
iov_iter_count(iter));
f38c7e3abfba9a Jens Axboe 2020-09-25 3537 ret = 0;
93096a0f2ab1b1 Pavel Begunkov 2021-02-04 3538 } else if (ret <= 0 || ret == io_size)
{
00d23d516e2e79 Jens Axboe 2020-08-25 3539 /* make sure -ERESTARTSYS -> -EINTR
is done */
00d23d516e2e79 Jens Axboe 2020-08-25 3540 goto done;
93096a0f2ab1b1 Pavel Begunkov 2021-02-04 3541 } else {
93096a0f2ab1b1 Pavel Begunkov 2021-02-04 3542 /* we did blocking attempt. no retry.
*/
93096a0f2ab1b1 Pavel Begunkov 2021-02-04 3543 if (!force_nonblock ||
(req->file->f_flags & O_NONBLOCK) ||
93096a0f2ab1b1 Pavel Begunkov 2021-02-04 3544 !(req->flags & REQ_F_ISREG))
227c0c9673d867 Jens Axboe 2020-08-13 3545 goto done;
227c0c9673d867 Jens Axboe 2020-08-13 3546
227c0c9673d867 Jens Axboe 2020-08-13 3547 io_size -= ret;
93096a0f2ab1b1 Pavel Begunkov 2021-02-04 3548 }
93096a0f2ab1b1 Pavel Begunkov 2021-02-04 3549
227c0c9673d867 Jens Axboe 2020-08-13 3550 ret2 = io_setup_async_rw(req, iovec,
inline_vecs, iter, true);
227c0c9673d867 Jens Axboe 2020-08-13 3551 if (ret2) {
227c0c9673d867 Jens Axboe 2020-08-13 3552 ret = ret2;
227c0c9673d867 Jens Axboe 2020-08-13 3553 goto out_free;
f67676d160c6ee Jens Axboe 2019-12-02 3554 }
f5cac8b156e8b7 Jens Axboe 2020-09-14 3555 if (no_async)
f5cac8b156e8b7 Jens Axboe 2020-09-14 3556 return -EAGAIN;
e8c2bc1fb6c949 Jens Axboe 2020-08-15 3557 rw = req->async_data;
227c0c9673d867 Jens Axboe 2020-08-13 3558 /* it's copied and will be cleaned
with ->io */
227c0c9673d867 Jens Axboe 2020-08-13 3559 iovec = NULL;
227c0c9673d867 Jens Axboe 2020-08-13 3560 /* now use our persistent iterator, if we
aren't already */
e8c2bc1fb6c949 Jens Axboe 2020-08-15 3561 iter = &rw->iter;
227c0c9673d867 Jens Axboe 2020-08-13 3562 retry:
e8c2bc1fb6c949 Jens Axboe 2020-08-15 3563 rw->bytes_done += ret;
227c0c9673d867 Jens Axboe 2020-08-13 3564 /* if we can retry, do so with the
callbacks armed */
227c0c9673d867 Jens Axboe 2020-08-13 3565 if (!io_rw_should_retry(req)) {
bcf5a06304d69a Jens Axboe 2020-05-22 3566 kiocb->ki_flags &= ~IOCB_WAITQ;
f67676d160c6ee Jens Axboe 2019-12-02 3567 return -EAGAIN;
2b188cc1bb857a Jens Axboe 2019-01-07 3568 }
227c0c9673d867 Jens Axboe 2020-08-13 3569
227c0c9673d867 Jens Axboe 2020-08-13 3570 /*
227c0c9673d867 Jens Axboe 2020-08-13 3571 * Now retry read with the IOCB_WAITQ
parts set in the iocb. If we
227c0c9673d867 Jens Axboe 2020-08-13 3572 * get -EIOCBQUEUED, then we'll get a
notification when the desired
227c0c9673d867 Jens Axboe 2020-08-13 3573 * page gets unlocked. We can also get a
partial read here, and if we
227c0c9673d867 Jens Axboe 2020-08-13 3574 * do, then just retry at the new
offset.
227c0c9673d867 Jens Axboe 2020-08-13 3575 */
227c0c9673d867 Jens Axboe 2020-08-13 3576 ret = io_iter_do_read(req, iter);
227c0c9673d867 Jens Axboe 2020-08-13 3577 if (ret == -EIOCBQUEUED) {
227c0c9673d867 Jens Axboe 2020-08-13 3578 ret = 0;
227c0c9673d867 Jens Axboe 2020-08-13 3579 goto out_free;
227c0c9673d867 Jens Axboe 2020-08-13 3580 } else if (ret > 0 && ret <
io_size) {
227c0c9673d867 Jens Axboe 2020-08-13 3581 /* we got some bytes, but not all.
retry. */
227c0c9673d867 Jens Axboe 2020-08-13 3582 goto retry;
227c0c9673d867 Jens Axboe 2020-08-13 3583 }
227c0c9673d867 Jens Axboe 2020-08-13 3584 done:
227c0c9673d867 Jens Axboe 2020-08-13 3585 kiocb_done(kiocb, ret, cs);
227c0c9673d867 Jens Axboe 2020-08-13 3586 ret = 0;
f67676d160c6ee Jens Axboe 2019-12-02 3587 out_free:
f261c16861b829 Pavel Begunkov 2020-08-20 3588 /* it's reportedly faster than
delegating the null check to kfree() */
252917c30f551e Pavel Begunkov 2020-07-13 3589 if (iovec)
2b188cc1bb857a Jens Axboe 2019-01-07 3590 kfree(iovec);
2b188cc1bb857a Jens Axboe 2019-01-07 3591 return ret;
2b188cc1bb857a Jens Axboe 2019-01-07 3592 }
2b188cc1bb857a Jens Axboe 2019-01-07 3593
:::::: The code at line 3517 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