tree:
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
queue-5.10
head: 9ced6633127bd25a94939777d9ecda54800859fc
commit: 107abcc47e3a96c38ab38e48dbd55f19c0a1c257 [64/74] io_uring: inline io_read()'s
iovec freeing
config: parisc-randconfig-r004-20210318 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0
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
#
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 107abcc47e3a96c38ab38e48dbd55f19c0a1c257
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=parisc
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: In function 'io_prep_async_work':
fs/io_uring.c:1431:22: warning: variable 'id' set but not used
[-Wunused-but-set-variable]
1431 | struct io_identity *id;
| ^~
fs/io_uring.c: In function 'io_read':
> fs/io_uring.c:3462:3: error: label 'out_free' used but
not defined
3462 | goto out_free;
| ^~~~
fs/io_uring.c:3427:3: error: label 'copy_iov' used but not defined
3427 | goto copy_iov;
| ^~~~
fs/io_uring.c: In function 'io_close':
fs/io_uring.c:4266:22: error: 'IO_WQ_WORK_NO_CANCEL' undeclared (first use in
this function); did you mean 'IO_WQ_WORK_CANCEL'?
4266 | req->work.flags |= IO_WQ_WORK_NO_CANCEL;
| ^~~~~~~~~~~~~~~~~~~~
| IO_WQ_WORK_CANCEL
fs/io_uring.c:4266:22: note: each undeclared identifier is reported only once for each
function it appears in
fs/io_uring.c: In function 'io_wq_submit_work':
fs/io_uring.c:6091:3: error: implicit declaration of function
'io_req_task_work_add_fallback'; did you mean 'io_req_task_work_add'?
[-Werror=implicit-function-declaration]
6091 | io_req_task_work_add_fallback(req, io_req_task_cancel);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| io_req_task_work_add
fs/io_uring.c:6092:3: error: 'return' with no value, in function returning
non-void [-Werror=return-type]
6092 | return;
| ^~~~~~
fs/io_uring.c:6077:27: note: declared here
6077 | static struct io_wq_work *io_wq_submit_work(struct io_wq_work *work)
| ^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/out_free +3462 fs/io_uring.c
f67676d160c6ee Jens Axboe 2019-12-02 3397
a1d7c393c4711a Jens Axboe 2020-06-22 3398 static int io_read(struct io_kiocb *req,
bool force_nonblock,
a1d7c393c4711a Jens Axboe 2020-06-22 3399 struct io_comp_state *cs)
2b188cc1bb857a Jens Axboe 2019-01-07 3400 {
2b188cc1bb857a Jens Axboe 2019-01-07 3401 struct iovec inline_vecs[UIO_FASTIOV],
*iovec = inline_vecs;
9adbd45d6d32ff Jens Axboe 2019-12-20 3402 struct kiocb *kiocb =
&req->rw.kiocb;
ff6165b2d7f66f Jens Axboe 2020-08-13 3403 struct iov_iter __iter, *iter =
&__iter;
e8c2bc1fb6c949 Jens Axboe 2020-08-15 3404 struct io_async_rw *rw =
req->async_data;
227c0c9673d867 Jens Axboe 2020-08-13 3405 ssize_t io_size, ret, ret2;
f5cac8b156e8b7 Jens Axboe 2020-09-14 3406 bool no_async;
ff6165b2d7f66f Jens Axboe 2020-08-13 3407
e8c2bc1fb6c949 Jens Axboe 2020-08-15 3408 if (rw)
e8c2bc1fb6c949 Jens Axboe 2020-08-15 3409 iter = &rw->iter;
2b188cc1bb857a Jens Axboe 2019-01-07 3410
ff6165b2d7f66f Jens Axboe 2020-08-13 3411 ret = io_import_iovec(READ, req,
&iovec, iter, !force_nonblock);
f67676d160c6ee Jens Axboe 2019-12-02 3412 if (ret < 0)
2b188cc1bb857a Jens Axboe 2019-01-07 3413 return ret;
758adcb5e98092 Pavel Begunkov 2020-11-07 3414 io_size = iov_iter_count(iter);
fa15bafb71fd7a Pavel Begunkov 2020-08-01 3415 req->result = io_size;
227c0c9673d867 Jens Axboe 2020-08-13 3416 ret = 0;
2b188cc1bb857a Jens Axboe 2019-01-07 3417
fd6c2e4c063d64 Jens Axboe 2019-12-18 3418 /* Ensure we clear previously set
non-block flag */
fd6c2e4c063d64 Jens Axboe 2019-12-18 3419 if (!force_nonblock)
29de5f6a350778 Jens Axboe 2020-02-20 3420 kiocb->ki_flags &= ~IOCB_NOWAIT;
a88fc400212fc1 Pavel Begunkov 2020-09-30 3421 else
a88fc400212fc1 Pavel Begunkov 2020-09-30 3422 kiocb->ki_flags |= IOCB_NOWAIT;
a88fc400212fc1 Pavel Begunkov 2020-09-30 3423
24c74678634b3c Pavel Begunkov 2020-06-21 3424 /* If the file doesn't support async,
just async punt */
f5cac8b156e8b7 Jens Axboe 2020-09-14 3425 no_async = force_nonblock &&
!io_file_supports_async(req->file, READ);
f5cac8b156e8b7 Jens Axboe 2020-09-14 3426 if (no_async)
f67676d160c6ee Jens Axboe 2019-12-02 3427 goto copy_iov;
9e645e1105ca60 Jens Axboe 2019-05-10 3428
758adcb5e98092 Pavel Begunkov 2020-11-07 3429 ret = rw_verify_area(READ, req->file,
io_kiocb_ppos(kiocb), io_size);
107abcc47e3a96 Pavel Begunkov 2021-02-04 3430 if (unlikely(ret)) {
107abcc47e3a96 Pavel Begunkov 2021-02-04 3431 kfree(iovec);
107abcc47e3a96 Pavel Begunkov 2021-02-04 3432 return ret;
107abcc47e3a96 Pavel Begunkov 2021-02-04 3433 }
2b188cc1bb857a Jens Axboe 2019-01-07 3434
227c0c9673d867 Jens Axboe 2020-08-13 3435 ret = io_iter_do_read(req, iter);
32960613b7c335 Jens Axboe 2019-09-23 3436
d964a45ff1644d Pavel Begunkov 2021-02-01 3437 if (ret == -EIOCBQUEUED) {
107abcc47e3a96 Pavel Begunkov 2021-02-04 3438 /* it's faster to check here then
delegate to kfree */
107abcc47e3a96 Pavel Begunkov 2021-02-04 3439 if (iovec)
107abcc47e3a96 Pavel Begunkov 2021-02-04 3440 kfree(iovec);
107abcc47e3a96 Pavel Begunkov 2021-02-04 3441 return 0;
227c0c9673d867 Jens Axboe 2020-08-13 3442 } else if (ret == -EAGAIN) {
eefdf30f3dcb5c Jens Axboe 2020-08-27 3443 /* IOPOLL retry should happen for io-wq
threads */
eefdf30f3dcb5c Jens Axboe 2020-08-27 3444 if (!force_nonblock &&
!(req->ctx->flags & IORING_SETUP_IOPOLL))
f91daf565b0e27 Jens Axboe 2020-08-15 3445 goto done;
355afaeb578aba Jens Axboe 2020-09-02 3446 /* no retry on NONBLOCK marked file */
355afaeb578aba Jens Axboe 2020-09-02 3447 if (req->file->f_flags &
O_NONBLOCK)
355afaeb578aba Jens Axboe 2020-09-02 3448 goto done;
842163154b87b0 Jens Axboe 2020-08-24 3449 /* some cases will consume bytes even on
error returns */
758adcb5e98092 Pavel Begunkov 2020-11-07 3450 iov_iter_revert(iter, io_size -
iov_iter_count(iter));
f38c7e3abfba9a Jens Axboe 2020-09-25 3451 ret = 0;
82b6fe19520be5 Pavel Begunkov 2021-02-04 3452 } else if (ret <= 0 || ret == io_size
|| !force_nonblock ||
82b6fe19520be5 Pavel Begunkov 2021-02-04 3453 (req->file->f_flags &
O_NONBLOCK) ||
82b6fe19520be5 Pavel Begunkov 2021-02-04 3454 !(req->flags & REQ_F_ISREG))
{
82b6fe19520be5 Pavel Begunkov 2021-02-04 3455 /* read all, failed, already did sync or
don't want to retry */
00d23d516e2e79 Jens Axboe 2020-08-25 3456 goto done;
75a2698c924a90 Pavel Begunkov 2021-02-04 3457 }
75a2698c924a90 Pavel Begunkov 2021-02-04 3458
227c0c9673d867 Jens Axboe 2020-08-13 3459 ret2 = io_setup_async_rw(req, iovec,
inline_vecs, iter, true);
227c0c9673d867 Jens Axboe 2020-08-13 3460 if (ret2) {
227c0c9673d867 Jens Axboe 2020-08-13 3461 ret = ret2;
227c0c9673d867 Jens Axboe 2020-08-13 @3462 goto out_free;
f67676d160c6ee Jens Axboe 2019-12-02 3463 }
f5cac8b156e8b7 Jens Axboe 2020-09-14 3464 if (no_async)
f5cac8b156e8b7 Jens Axboe 2020-09-14 3465 return -EAGAIN;
e8c2bc1fb6c949 Jens Axboe 2020-08-15 3466 rw = req->async_data;
227c0c9673d867 Jens Axboe 2020-08-13 3467 /* now use our persistent iterator, if we
aren't already */
e8c2bc1fb6c949 Jens Axboe 2020-08-15 3468 iter = &rw->iter;
227c0c9673d867 Jens Axboe 2020-08-13 3469 retry:
82b6fe19520be5 Pavel Begunkov 2021-02-04 3470 io_size -= ret;
e8c2bc1fb6c949 Jens Axboe 2020-08-15 3471 rw->bytes_done += ret;
227c0c9673d867 Jens Axboe 2020-08-13 3472 /* if we can retry, do so with the
callbacks armed */
227c0c9673d867 Jens Axboe 2020-08-13 3473 if (!io_rw_should_retry(req)) {
bcf5a06304d69a Jens Axboe 2020-05-22 3474 kiocb->ki_flags &= ~IOCB_WAITQ;
f67676d160c6ee Jens Axboe 2019-12-02 3475 return -EAGAIN;
2b188cc1bb857a Jens Axboe 2019-01-07 3476 }
227c0c9673d867 Jens Axboe 2020-08-13 3477
227c0c9673d867 Jens Axboe 2020-08-13 3478 /*
227c0c9673d867 Jens Axboe 2020-08-13 3479 * Now retry read with the IOCB_WAITQ
parts set in the iocb. If we
227c0c9673d867 Jens Axboe 2020-08-13 3480 * get -EIOCBQUEUED, then we'll get a
notification when the desired
227c0c9673d867 Jens Axboe 2020-08-13 3481 * page gets unlocked. We can also get a
partial read here, and if we
227c0c9673d867 Jens Axboe 2020-08-13 3482 * do, then just retry at the new
offset.
227c0c9673d867 Jens Axboe 2020-08-13 3483 */
227c0c9673d867 Jens Axboe 2020-08-13 3484 ret = io_iter_do_read(req, iter);
107abcc47e3a96 Pavel Begunkov 2021-02-04 3485 if (ret == -EIOCBQUEUED)
107abcc47e3a96 Pavel Begunkov 2021-02-04 3486 return 0;
227c0c9673d867 Jens Axboe 2020-08-13 3487 /* we got some bytes, but not all. retry.
*/
107abcc47e3a96 Pavel Begunkov 2021-02-04 3488 if (ret > 0 && ret <
io_size)
227c0c9673d867 Jens Axboe 2020-08-13 3489 goto retry;
227c0c9673d867 Jens Axboe 2020-08-13 3490 done:
227c0c9673d867 Jens Axboe 2020-08-13 3491 kiocb_done(kiocb, ret, cs);
107abcc47e3a96 Pavel Begunkov 2021-02-04 3492 return 0;
2b188cc1bb857a Jens Axboe 2019-01-07 3493 }
2b188cc1bb857a Jens Axboe 2019-01-07 3494
:::::: The code at line 3462 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