public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Caleb Sander Mateos <csander@purestorage.com>,
	Jens Axboe <axboe@kernel.dk>, Miklos Szeredi <miklos@szeredi.hu>,
	Ming Lei <ming.lei@redhat.com>, Keith Busch <kbusch@kernel.org>,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	Chris Mason <chris.mason@fusionio.com>,
	David Sterba <dsterba@suse.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	io-uring@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-block@vger.kernel.org, linux-nvme@lists.infradead.org,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	Caleb Sander Mateos <csander@purestorage.com>
Subject: Re: [PATCH 3/3] io_uring/uring_cmd: avoid double indirect call in task work dispatch
Date: Thu, 23 Oct 2025 20:05:39 +0800	[thread overview]
Message-ID: <202510231952.gAXMcT2A-lkp@intel.com> (raw)
In-Reply-To: <20251022231326.2527838-4-csander@purestorage.com>

Hi Caleb,

kernel test robot noticed the following build errors:

[auto build test ERROR on axboe-block/for-next]
[also build test ERROR on kdave/for-next linus/master v6.18-rc2]
[cannot apply to mszeredi-fuse/for-next linux-nvme/for-next next-20251023]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Caleb-Sander-Mateos/io_uring-expose-io_should_terminate_tw/20251023-071617
base:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next
patch link:    https://lore.kernel.org/r/20251022231326.2527838-4-csander%40purestorage.com
patch subject: [PATCH 3/3] io_uring/uring_cmd: avoid double indirect call in task work dispatch
config: x86_64-buildonly-randconfig-005-20251023 (https://download.01.org/0day-ci/archive/20251023/202510231952.gAXMcT2A-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251023/202510231952.gAXMcT2A-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510231952.gAXMcT2A-lkp@intel.com/

All errors (new ones prefixed by >>):

>> block/ioctl.c:783:1: error: invalid storage class specifier in function declarator
     783 | static void bio_cmd_bio_end_io(struct bio *bio)
         | ^
>> block/ioctl.c:783:13: error: parameter named 'bio_cmd_bio_end_io' is missing
     783 | static void bio_cmd_bio_end_io(struct bio *bio)
         |             ^
>> block/ioctl.c:783:48: error: expected ';' at end of declaration
     783 | static void bio_cmd_bio_end_io(struct bio *bio)
         |                                                ^
         |                                                ;
>> block/ioctl.c:781:38: error: parameter 'blk_cmd_complete' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
     781 | static DEFINE_IO_URING_CMD_TASK_WORK(blk_cmd_complete)
         |                                      ^
     782 | 
     783 | static void bio_cmd_bio_end_io(struct bio *bio)
     784 | {
>> block/ioctl.c:781:8: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
     781 | static DEFINE_IO_URING_CMD_TASK_WORK(blk_cmd_complete)
         | ~~~~~~ ^
         | int
>> block/ioctl.c:785:29: error: use of undeclared identifier 'bio'
     785 |         struct io_uring_cmd *cmd = bio->bi_private;
         |                                    ^
   block/ioctl.c:788:15: error: use of undeclared identifier 'bio'
     788 |         if (unlikely(bio->bi_status) && !bic->res)
         |                      ^
   block/ioctl.c:789:34: error: use of undeclared identifier 'bio'
     789 |                 bic->res = blk_status_to_errno(bio->bi_status);
         |                                                ^
>> block/ioctl.c:791:2: error: call to undeclared function 'IO_URING_CMD_TASK_WORK'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     791 |         io_uring_cmd_do_in_task_lazy(cmd, blk_cmd_complete);
         |         ^
   include/linux/io_uring/cmd.h:149:7: note: expanded from macro 'io_uring_cmd_do_in_task_lazy'
     149 |                                   IO_URING_CMD_TASK_WORK(uring_cmd_cb),         \
         |                                   ^
   block/ioctl.c:791:2: note: did you mean 'DEFINE_IO_URING_CMD_TASK_WORK'?
   include/linux/io_uring/cmd.h:149:7: note: expanded from macro 'io_uring_cmd_do_in_task_lazy'
     149 |                                   IO_URING_CMD_TASK_WORK(uring_cmd_cb),         \
         |                                   ^
   block/ioctl.c:781:8: note: 'DEFINE_IO_URING_CMD_TASK_WORK' declared here
     781 | static DEFINE_IO_URING_CMD_TASK_WORK(blk_cmd_complete)
         |        ^
>> block/ioctl.c:791:2: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'io_req_tw_func_t' (aka 'void (*)(struct io_kiocb *, struct io_tw_state)') [-Wint-conversion]
     791 |         io_uring_cmd_do_in_task_lazy(cmd, blk_cmd_complete);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/io_uring/cmd.h:149:7: note: expanded from macro 'io_uring_cmd_do_in_task_lazy'
     149 |                                   IO_URING_CMD_TASK_WORK(uring_cmd_cb),         \
         |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/io_uring/cmd.h:123:25: note: passing argument to parameter 'task_work_cb' here
     123 |                             io_req_tw_func_t task_work_cb, unsigned flags)
         |                                              ^
   block/ioctl.c:792:10: error: use of undeclared identifier 'bio'; did you mean 'bic'?
     792 |         bio_put(bio);
         |                 ^~~
         |                 bic
   block/ioctl.c:786:22: note: 'bic' declared here
     786 |         struct blk_iou_cmd *bic = io_uring_cmd_to_pdu(cmd, struct blk_iou_cmd);
         |                             ^
>> block/ioctl.c:781:8: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C23 [-Werror,-Wdeprecated-non-prototype]
     781 | static DEFINE_IO_URING_CMD_TASK_WORK(blk_cmd_complete)
         |        ^
>> block/ioctl.c:847:20: error: use of undeclared identifier 'bio_cmd_bio_end_io'
     847 |         prev->bi_end_io = bio_cmd_bio_end_io;
         |                           ^
   13 errors generated.
--
>> drivers/nvme/host/ioctl.c:412:1: error: invalid storage class specifier in function declarator
     412 | static enum rq_end_io_ret nvme_uring_cmd_end_io(struct request *req,
         | ^
>> drivers/nvme/host/ioctl.c:412:27: error: parameter named 'nvme_uring_cmd_end_io' is missing
     412 | static enum rq_end_io_ret nvme_uring_cmd_end_io(struct request *req,
         |                           ^
>> drivers/nvme/host/ioctl.c:413:24: error: expected ';' at end of declaration
     413 |                                                 blk_status_t err)
         |                                                                  ^
         |                                                                  ;
>> drivers/nvme/host/ioctl.c:410:38: error: parameter 'nvme_uring_task_cb' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
     410 | static DEFINE_IO_URING_CMD_TASK_WORK(nvme_uring_task_cb)
         |                                      ^
     411 | 
     412 | static enum rq_end_io_ret nvme_uring_cmd_end_io(struct request *req,
     413 |                                                 blk_status_t err)
     414 | {
>> drivers/nvme/host/ioctl.c:410:8: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
     410 | static DEFINE_IO_URING_CMD_TASK_WORK(nvme_uring_task_cb)
         | ~~~~~~ ^
         | int
>> drivers/nvme/host/ioctl.c:415:32: error: use of undeclared identifier 'req'
     415 |         struct io_uring_cmd *ioucmd = req->end_io_data;
         |                                       ^
   drivers/nvme/host/ioctl.c:418:15: error: use of undeclared identifier 'req'
     418 |         if (nvme_req(req)->flags & NVME_REQ_CANCELLED) {
         |                      ^
   drivers/nvme/host/ioctl.c:421:26: error: use of undeclared identifier 'req'
     421 |                 pdu->status = nvme_req(req)->status;
         |                                        ^
>> drivers/nvme/host/ioctl.c:423:38: error: use of undeclared identifier 'err'
     423 |                         pdu->status = blk_status_to_errno(err);
         |                                                           ^
   drivers/nvme/host/ioctl.c:425:37: error: use of undeclared identifier 'req'
     425 |         pdu->result = le64_to_cpu(nvme_req(req)->result.u64);
         |                                            ^
   include/linux/byteorder/generic.h:87:21: note: expanded from macro 'le64_to_cpu'
      87 | #define le64_to_cpu __le64_to_cpu
         |                     ^
>> drivers/nvme/host/ioctl.c:435:2: error: call to undeclared function 'IO_URING_CMD_TASK_WORK'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     435 |         io_uring_cmd_do_in_task_lazy(ioucmd, nvme_uring_task_cb);
         |         ^
   include/linux/io_uring/cmd.h:149:7: note: expanded from macro 'io_uring_cmd_do_in_task_lazy'
     149 |                                   IO_URING_CMD_TASK_WORK(uring_cmd_cb),         \
         |                                   ^
   drivers/nvme/host/ioctl.c:435:2: note: did you mean 'DEFINE_IO_URING_CMD_TASK_WORK'?
   include/linux/io_uring/cmd.h:149:7: note: expanded from macro 'io_uring_cmd_do_in_task_lazy'
     149 |                                   IO_URING_CMD_TASK_WORK(uring_cmd_cb),         \
         |                                   ^
   drivers/nvme/host/ioctl.c:410:8: note: 'DEFINE_IO_URING_CMD_TASK_WORK' declared here
     410 | static DEFINE_IO_URING_CMD_TASK_WORK(nvme_uring_task_cb)
         |        ^
>> drivers/nvme/host/ioctl.c:435:2: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'io_req_tw_func_t' (aka 'void (*)(struct io_kiocb *, struct io_tw_state)') [-Wint-conversion]
     435 |         io_uring_cmd_do_in_task_lazy(ioucmd, nvme_uring_task_cb);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/io_uring/cmd.h:149:7: note: expanded from macro 'io_uring_cmd_do_in_task_lazy'
     149 |                                   IO_URING_CMD_TASK_WORK(uring_cmd_cb),         \
         |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/io_uring/cmd.h:123:25: note: passing argument to parameter 'task_work_cb' here
     123 |                             io_req_tw_func_t task_work_cb, unsigned flags)
         |                                              ^
>> drivers/nvme/host/ioctl.c:410:8: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C23 [-Werror,-Wdeprecated-non-prototype]
     410 | static DEFINE_IO_URING_CMD_TASK_WORK(nvme_uring_task_cb)
         |        ^
>> drivers/nvme/host/ioctl.c:524:16: error: use of undeclared identifier 'nvme_uring_cmd_end_io'; did you mean 'nvme_uring_cmd_io'?
     524 |         req->end_io = nvme_uring_cmd_end_io;
         |                       ^~~~~~~~~~~~~~~~~~~~~
         |                       nvme_uring_cmd_io
   drivers/nvme/host/ioctl.c:439:12: note: 'nvme_uring_cmd_io' declared here
     439 | static int nvme_uring_cmd_io(struct nvme_ctrl *ctrl, struct nvme_ns *ns,
         |            ^
   14 errors generated.


vim +783 block/ioctl.c

50c52250e2d74b Pavel Begunkov      2024-09-11  771  
50c52250e2d74b Pavel Begunkov      2024-09-11  772  static void blk_cmd_complete(struct io_uring_cmd *cmd, unsigned int issue_flags)
50c52250e2d74b Pavel Begunkov      2024-09-11  773  {
50c52250e2d74b Pavel Begunkov      2024-09-11  774  	struct blk_iou_cmd *bic = io_uring_cmd_to_pdu(cmd, struct blk_iou_cmd);
50c52250e2d74b Pavel Begunkov      2024-09-11  775  
50c52250e2d74b Pavel Begunkov      2024-09-11  776  	if (bic->res == -EAGAIN && bic->nowait)
50c52250e2d74b Pavel Begunkov      2024-09-11  777  		io_uring_cmd_issue_blocking(cmd);
50c52250e2d74b Pavel Begunkov      2024-09-11  778  	else
ef9f603fd3d4b7 Caleb Sander Mateos 2025-09-22  779  		io_uring_cmd_done(cmd, bic->res, issue_flags);
50c52250e2d74b Pavel Begunkov      2024-09-11  780  }
c004e50b1d8661 Caleb Sander Mateos 2025-10-22 @781  static DEFINE_IO_URING_CMD_TASK_WORK(blk_cmd_complete)
50c52250e2d74b Pavel Begunkov      2024-09-11  782  
50c52250e2d74b Pavel Begunkov      2024-09-11 @783  static void bio_cmd_bio_end_io(struct bio *bio)
50c52250e2d74b Pavel Begunkov      2024-09-11  784  {
50c52250e2d74b Pavel Begunkov      2024-09-11 @785  	struct io_uring_cmd *cmd = bio->bi_private;
50c52250e2d74b Pavel Begunkov      2024-09-11  786  	struct blk_iou_cmd *bic = io_uring_cmd_to_pdu(cmd, struct blk_iou_cmd);
50c52250e2d74b Pavel Begunkov      2024-09-11  787  
50c52250e2d74b Pavel Begunkov      2024-09-11  788  	if (unlikely(bio->bi_status) && !bic->res)
50c52250e2d74b Pavel Begunkov      2024-09-11  789  		bic->res = blk_status_to_errno(bio->bi_status);
50c52250e2d74b Pavel Begunkov      2024-09-11  790  
50c52250e2d74b Pavel Begunkov      2024-09-11 @791  	io_uring_cmd_do_in_task_lazy(cmd, blk_cmd_complete);
50c52250e2d74b Pavel Begunkov      2024-09-11  792  	bio_put(bio);
50c52250e2d74b Pavel Begunkov      2024-09-11  793  }
50c52250e2d74b Pavel Begunkov      2024-09-11  794  
50c52250e2d74b Pavel Begunkov      2024-09-11  795  static int blkdev_cmd_discard(struct io_uring_cmd *cmd,
50c52250e2d74b Pavel Begunkov      2024-09-11  796  			      struct block_device *bdev,
50c52250e2d74b Pavel Begunkov      2024-09-11  797  			      uint64_t start, uint64_t len, bool nowait)
50c52250e2d74b Pavel Begunkov      2024-09-11  798  {
50c52250e2d74b Pavel Begunkov      2024-09-11  799  	struct blk_iou_cmd *bic = io_uring_cmd_to_pdu(cmd, struct blk_iou_cmd);
50c52250e2d74b Pavel Begunkov      2024-09-11  800  	gfp_t gfp = nowait ? GFP_NOWAIT : GFP_KERNEL;
50c52250e2d74b Pavel Begunkov      2024-09-11  801  	sector_t sector = start >> SECTOR_SHIFT;
50c52250e2d74b Pavel Begunkov      2024-09-11  802  	sector_t nr_sects = len >> SECTOR_SHIFT;
50c52250e2d74b Pavel Begunkov      2024-09-11  803  	struct bio *prev = NULL, *bio;
50c52250e2d74b Pavel Begunkov      2024-09-11  804  	int err;
50c52250e2d74b Pavel Begunkov      2024-09-11  805  
50c52250e2d74b Pavel Begunkov      2024-09-11  806  	if (!bdev_max_discard_sectors(bdev))
50c52250e2d74b Pavel Begunkov      2024-09-11  807  		return -EOPNOTSUPP;
50c52250e2d74b Pavel Begunkov      2024-09-11  808  	if (!(file_to_blk_mode(cmd->file) & BLK_OPEN_WRITE))
50c52250e2d74b Pavel Begunkov      2024-09-11  809  		return -EBADF;
50c52250e2d74b Pavel Begunkov      2024-09-11  810  	if (bdev_read_only(bdev))
50c52250e2d74b Pavel Begunkov      2024-09-11  811  		return -EPERM;
50c52250e2d74b Pavel Begunkov      2024-09-11  812  	err = blk_validate_byte_range(bdev, start, len);
50c52250e2d74b Pavel Begunkov      2024-09-11  813  	if (err)
50c52250e2d74b Pavel Begunkov      2024-09-11  814  		return err;
50c52250e2d74b Pavel Begunkov      2024-09-11  815  
50c52250e2d74b Pavel Begunkov      2024-09-11  816  	err = filemap_invalidate_pages(bdev->bd_mapping, start,
50c52250e2d74b Pavel Begunkov      2024-09-11  817  					start + len - 1, nowait);
50c52250e2d74b Pavel Begunkov      2024-09-11  818  	if (err)
50c52250e2d74b Pavel Begunkov      2024-09-11  819  		return err;
50c52250e2d74b Pavel Begunkov      2024-09-11  820  
50c52250e2d74b Pavel Begunkov      2024-09-11  821  	while (true) {
50c52250e2d74b Pavel Begunkov      2024-09-11  822  		bio = blk_alloc_discard_bio(bdev, &sector, &nr_sects, gfp);
50c52250e2d74b Pavel Begunkov      2024-09-11  823  		if (!bio)
50c52250e2d74b Pavel Begunkov      2024-09-11  824  			break;
50c52250e2d74b Pavel Begunkov      2024-09-11  825  		if (nowait) {
50c52250e2d74b Pavel Begunkov      2024-09-11  826  			/*
50c52250e2d74b Pavel Begunkov      2024-09-11  827  			 * Don't allow multi-bio non-blocking submissions as
50c52250e2d74b Pavel Begunkov      2024-09-11  828  			 * subsequent bios may fail but we won't get a direct
50c52250e2d74b Pavel Begunkov      2024-09-11  829  			 * indication of that. Normally, the caller should
50c52250e2d74b Pavel Begunkov      2024-09-11  830  			 * retry from a blocking context.
50c52250e2d74b Pavel Begunkov      2024-09-11  831  			 */
50c52250e2d74b Pavel Begunkov      2024-09-11  832  			if (unlikely(nr_sects)) {
50c52250e2d74b Pavel Begunkov      2024-09-11  833  				bio_put(bio);
50c52250e2d74b Pavel Begunkov      2024-09-11  834  				return -EAGAIN;
50c52250e2d74b Pavel Begunkov      2024-09-11  835  			}
50c52250e2d74b Pavel Begunkov      2024-09-11  836  			bio->bi_opf |= REQ_NOWAIT;
50c52250e2d74b Pavel Begunkov      2024-09-11  837  		}
50c52250e2d74b Pavel Begunkov      2024-09-11  838  
50c52250e2d74b Pavel Begunkov      2024-09-11  839  		prev = bio_chain_and_submit(prev, bio);
50c52250e2d74b Pavel Begunkov      2024-09-11  840  	}
50c52250e2d74b Pavel Begunkov      2024-09-11  841  	if (unlikely(!prev))
50c52250e2d74b Pavel Begunkov      2024-09-11  842  		return -EAGAIN;
50c52250e2d74b Pavel Begunkov      2024-09-11  843  	if (unlikely(nr_sects))
50c52250e2d74b Pavel Begunkov      2024-09-11  844  		bic->res = -EAGAIN;
50c52250e2d74b Pavel Begunkov      2024-09-11  845  
50c52250e2d74b Pavel Begunkov      2024-09-11  846  	prev->bi_private = cmd;
50c52250e2d74b Pavel Begunkov      2024-09-11 @847  	prev->bi_end_io = bio_cmd_bio_end_io;
50c52250e2d74b Pavel Begunkov      2024-09-11  848  	submit_bio(prev);
50c52250e2d74b Pavel Begunkov      2024-09-11  849  	return -EIOCBQUEUED;
50c52250e2d74b Pavel Begunkov      2024-09-11  850  }
50c52250e2d74b Pavel Begunkov      2024-09-11  851  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  reply	other threads:[~2025-10-23 12:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22 23:13 [PATCH 0/3] io_uring/uring_cmd: avoid double indirect call in task work dispatch Caleb Sander Mateos
2025-10-22 23:13 ` [PATCH 1/3] io_uring: expose io_should_terminate_tw() Caleb Sander Mateos
2025-10-22 23:13 ` [PATCH 2/3] io_uring/uring_cmd: call io_should_terminate_tw() when needed Caleb Sander Mateos
2025-10-22 23:13 ` [PATCH 3/3] io_uring/uring_cmd: avoid double indirect call in task work dispatch Caleb Sander Mateos
2025-10-23 12:05   ` kernel test robot [this message]
2025-10-23 13:40   ` Christoph Hellwig
2025-10-23 19:12     ` Caleb Sander Mateos
2025-10-23 19:49   ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202510231952.gAXMcT2A-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=axboe@kernel.dk \
    --cc=chris.mason@fusionio.com \
    --cc=csander@purestorage.com \
    --cc=dsterba@suse.com \
    --cc=hch@lst.de \
    --cc=io-uring@vger.kernel.org \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=llvm@lists.linux.dev \
    --cc=miklos@szeredi.hu \
    --cc=ming.lei@redhat.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox