io_uring/io_uring.c:578:28: sparse: sparse: invalid assignment: |=

From: kernel test robot

Date: Sun Feb 15 2026 - 22:14:35 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 26a4cfaff82a2dcb810f6bfd5f4842f9b6046c8a
commit: fde04c7e2775feb0746301e0ef86a04d3598c3fe io_uring: fix spurious drain flushing
date: 9 months ago
config: alpha-randconfig-r134-20260216 (https://download.01.org/0day-ci/archive/20260216/202602161110.UdSSYGJ6-lkp@xxxxxxxxx/config)
compiler: alpha-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260216/202602161110.UdSSYGJ6-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602161110.UdSSYGJ6-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
io_uring/io_uring.c: note: in included file (through include/linux/io_uring/cmd.h):
include/linux/io_uring_types.h:199:37: sparse: sparse: array of flexible structures
>> io_uring/io_uring.c:578:28: sparse: sparse: invalid assignment: |=
io_uring/io_uring.c:578:28: sparse: left side has type bool
io_uring/io_uring.c:578:28: sparse: right side has type restricted io_req_flags_t
io_uring/io_uring.c:619:36: sparse: sparse: context imbalance in 'io_req_post_cqe' - unexpected unlock
io_uring/io_uring.c:621:17: sparse: sparse: context imbalance in '__io_submit_flush_completions' - different lock contexts for basic block

vim +578 io_uring/io_uring.c

568
569 static __cold noinline void io_queue_deferred(struct io_ring_ctx *ctx)
570 {
571 bool drain_seen = false, first = true;
572
573 spin_lock(&ctx->completion_lock);
574 while (!list_empty(&ctx->defer_list)) {
575 struct io_defer_entry *de = list_first_entry(&ctx->defer_list,
576 struct io_defer_entry, list);
577
> 578 drain_seen |= de->req->flags & REQ_F_IO_DRAIN;
579 if ((drain_seen || first) && io_drain_defer_seq(de->req, de->seq))
580 break;
581
582 list_del_init(&de->list);
583 io_req_task_queue(de->req);
584 kfree(de);
585 first = false;
586 }
587 spin_unlock(&ctx->completion_lock);
588 }
589

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