Re: [PATCH] io_uring: Fix reversed nonblock flag

From: kbuild test robot
Date: Fri Oct 04 2019 - 05:34:14 EST


Hi "Pavel,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[cannot apply to v5.4-rc1 next-20191002]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url: https://github.com/0day-ci/linux/commits/Pavel-Begunkov-Silence/io_uring-Fix-reversed-nonblock-flag/20191004-163432
config: sparc-allyesconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 7.4.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=sparc

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

fs/io_uring.c: In function 'io_ring_submit':
>> fs/io_uring.c:2764:6: error: 'force_nonblock' undeclared (first use in this function); did you mean 'lock_pin_lock'?
force_nonblock);
^~~~~~~~~~~~~~
lock_pin_lock
fs/io_uring.c:2764:6: note: each undeclared identifier is reported only once for each function it appears in

vim +2764 fs/io_uring.c

2697
2698 static int io_ring_submit(struct io_ring_ctx *ctx, unsigned int to_submit,
2699 bool block_for_last)
2700 {
2701 struct io_submit_state state, *statep = NULL;
2702 struct io_kiocb *link = NULL;
2703 struct io_kiocb *shadow_req = NULL;
2704 bool prev_was_link = false;
2705 int i, submit = 0;
2706
2707 if (to_submit > IO_PLUG_THRESHOLD) {
2708 io_submit_state_start(&state, ctx, to_submit);
2709 statep = &state;
2710 }
2711
2712 for (i = 0; i < to_submit; i++) {
2713 bool force_nonblock = true;
2714 struct sqe_submit s;
2715
2716 if (!io_get_sqring(ctx, &s))
2717 break;
2718
2719 /*
2720 * If previous wasn't linked and we have a linked command,
2721 * that's the end of the chain. Submit the previous link.
2722 */
2723 if (!prev_was_link && link) {
2724 io_queue_link_head(ctx, link, &link->submit, shadow_req,
2725 force_nonblock);
2726 link = NULL;
2727 shadow_req = NULL;
2728 }
2729 prev_was_link = (s.sqe->flags & IOSQE_IO_LINK) != 0;
2730
2731 if (link && (s.sqe->flags & IOSQE_IO_DRAIN)) {
2732 if (!shadow_req) {
2733 shadow_req = io_get_req(ctx, NULL);
2734 if (unlikely(!shadow_req))
2735 goto out;
2736 shadow_req->flags |= (REQ_F_IO_DRAIN | REQ_F_SHADOW_DRAIN);
2737 refcount_dec(&shadow_req->refs);
2738 }
2739 shadow_req->sequence = s.sequence;
2740 }
2741
2742 out:
2743 s.has_user = true;
2744 s.needs_lock = false;
2745 s.needs_fixed_file = false;
2746 submit++;
2747
2748 /*
2749 * The caller will block for events after submit, submit the
2750 * last IO non-blocking. This is either the only IO it's
2751 * submitting, or it already submitted the previous ones. This
2752 * improves performance by avoiding an async punt that we don't
2753 * need to do.
2754 */
2755 if (block_for_last && submit == to_submit)
2756 force_nonblock = false;
2757
2758 io_submit_sqe(ctx, &s, statep, &link, force_nonblock);
2759 }
2760 io_commit_sqring(ctx);
2761
2762 if (link)
2763 io_queue_link_head(ctx, link, &link->submit, shadow_req,
> 2764 force_nonblock);
2765 if (statep)
2766 io_submit_state_end(statep);
2767
2768 return submit;
2769 }
2770

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip