tree:
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
queue-5.11
head: 8c3b9b9eb43a7ddb91a2a4c84f0bfa5f118894ae
commit: 20082229e8da2090ab40b5f7d72f9a567fe3812e [12/22] io_uring: inline io_read()'s
iovec freeing
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 20082229e8da2090ab40b5f7d72f9a567fe3812e
# 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:3552:8: error: use of undeclared label
'out_free'
goto out_free;
^
fs/io_uring.c:3517:8: error: use of undeclared label 'copy_iov'
goto copy_iov;
^
2 errors generated.
vim +/out_free +3552 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);
20082229e8da20 Pavel Begunkov 2021-02-04 3520 if (unlikely(ret)) {
20082229e8da20 Pavel Begunkov 2021-02-04 3521 kfree(iovec);
20082229e8da20 Pavel Begunkov 2021-02-04 3522 return ret;
20082229e8da20 Pavel Begunkov 2021-02-04 3523 }
2b188cc1bb857a Jens Axboe 2019-01-07 3524
227c0c9673d867 Jens Axboe 2020-08-13 3525 ret = io_iter_do_read(req, iter);
32960613b7c335 Jens Axboe 2019-09-23 3526
447313db13e52f Pavel Begunkov 2021-02-01 3527 if (ret == -EIOCBQUEUED) {
20082229e8da20 Pavel Begunkov 2021-02-04 3528 /* it's faster to check here then
delegate to kfree */
20082229e8da20 Pavel Begunkov 2021-02-04 3529 if (iovec)
20082229e8da20 Pavel Begunkov 2021-02-04 3530 kfree(iovec);
20082229e8da20 Pavel Begunkov 2021-02-04 3531 return 0;
227c0c9673d867 Jens Axboe 2020-08-13 3532 } else if (ret == -EAGAIN) {
eefdf30f3dcb5c Jens Axboe 2020-08-27 3533 /* IOPOLL retry should happen for io-wq
threads */
eefdf30f3dcb5c Jens Axboe 2020-08-27 3534 if (!force_nonblock &&
!(req->ctx->flags & IORING_SETUP_IOPOLL))
f91daf565b0e27 Jens Axboe 2020-08-15 3535 goto done;
355afaeb578aba Jens Axboe 2020-09-02 3536 /* no retry on NONBLOCK marked file */
355afaeb578aba Jens Axboe 2020-09-02 3537 if (req->file->f_flags &
O_NONBLOCK)
355afaeb578aba Jens Axboe 2020-09-02 3538 goto done;
842163154b87b0 Jens Axboe 2020-08-24 3539 /* some cases will consume bytes even on
error returns */
632546c4b5a4da Pavel Begunkov 2020-11-07 3540 iov_iter_revert(iter, io_size -
iov_iter_count(iter));
f38c7e3abfba9a Jens Axboe 2020-09-25 3541 ret = 0;
4866e0c1cb8970 Pavel Begunkov 2021-02-04 3542 } else if (ret <= 0 || ret == io_size
|| !force_nonblock ||
4866e0c1cb8970 Pavel Begunkov 2021-02-04 3543 (req->file->f_flags &
O_NONBLOCK) ||
4866e0c1cb8970 Pavel Begunkov 2021-02-04 3544 !(req->flags & REQ_F_ISREG))
{
4866e0c1cb8970 Pavel Begunkov 2021-02-04 3545 /* read all, failed, already did sync or
don't want to retry */
00d23d516e2e79 Jens Axboe 2020-08-25 3546 goto done;
93096a0f2ab1b1 Pavel Begunkov 2021-02-04 3547 }
93096a0f2ab1b1 Pavel Begunkov 2021-02-04 3548
227c0c9673d867 Jens Axboe 2020-08-13 3549 ret2 = io_setup_async_rw(req, iovec,
inline_vecs, iter, true);
227c0c9673d867 Jens Axboe 2020-08-13 3550 if (ret2) {
227c0c9673d867 Jens Axboe 2020-08-13 3551 ret = ret2;
227c0c9673d867 Jens Axboe 2020-08-13 @3552 goto out_free;
f67676d160c6ee Jens Axboe 2019-12-02 3553 }
f5cac8b156e8b7 Jens Axboe 2020-09-14 3554 if (no_async)
f5cac8b156e8b7 Jens Axboe 2020-09-14 3555 return -EAGAIN;
e8c2bc1fb6c949 Jens Axboe 2020-08-15 3556 rw = req->async_data;
227c0c9673d867 Jens Axboe 2020-08-13 3557 /* now use our persistent iterator, if we
aren't already */
e8c2bc1fb6c949 Jens Axboe 2020-08-15 3558 iter = &rw->iter;
227c0c9673d867 Jens Axboe 2020-08-13 3559 retry:
4866e0c1cb8970 Pavel Begunkov 2021-02-04 3560 io_size -= ret;
e8c2bc1fb6c949 Jens Axboe 2020-08-15 3561 rw->bytes_done += ret;
227c0c9673d867 Jens Axboe 2020-08-13 3562 /* if we can retry, do so with the
callbacks armed */
227c0c9673d867 Jens Axboe 2020-08-13 3563 if (!io_rw_should_retry(req)) {
bcf5a06304d69a Jens Axboe 2020-05-22 3564 kiocb->ki_flags &= ~IOCB_WAITQ;
f67676d160c6ee Jens Axboe 2019-12-02 3565 return -EAGAIN;
2b188cc1bb857a Jens Axboe 2019-01-07 3566 }
227c0c9673d867 Jens Axboe 2020-08-13 3567
227c0c9673d867 Jens Axboe 2020-08-13 3568 /*
227c0c9673d867 Jens Axboe 2020-08-13 3569 * Now retry read with the IOCB_WAITQ
parts set in the iocb. If we
227c0c9673d867 Jens Axboe 2020-08-13 3570 * get -EIOCBQUEUED, then we'll get a
notification when the desired
227c0c9673d867 Jens Axboe 2020-08-13 3571 * page gets unlocked. We can also get a
partial read here, and if we
227c0c9673d867 Jens Axboe 2020-08-13 3572 * do, then just retry at the new
offset.
227c0c9673d867 Jens Axboe 2020-08-13 3573 */
227c0c9673d867 Jens Axboe 2020-08-13 3574 ret = io_iter_do_read(req, iter);
20082229e8da20 Pavel Begunkov 2021-02-04 3575 if (ret == -EIOCBQUEUED)
20082229e8da20 Pavel Begunkov 2021-02-04 3576 return 0;
227c0c9673d867 Jens Axboe 2020-08-13 3577 /* we got some bytes, but not all. retry.
*/
20082229e8da20 Pavel Begunkov 2021-02-04 3578 if (ret > 0 && ret <
io_size)
227c0c9673d867 Jens Axboe 2020-08-13 3579 goto retry;
227c0c9673d867 Jens Axboe 2020-08-13 3580 done:
227c0c9673d867 Jens Axboe 2020-08-13 3581 kiocb_done(kiocb, ret, cs);
20082229e8da20 Pavel Begunkov 2021-02-04 3582 return 0;
2b188cc1bb857a Jens Axboe 2019-01-07 3583 }
2b188cc1bb857a Jens Axboe 2019-01-07 3584
:::::: The code at line 3552 was first introduced by commit
:::::: 227c0c9673d86732995474d277f84e08ee763e46 io_uring: internally retry short reads
:::::: 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