linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [bug report] io_uring: add task fork hook
       [not found] <caa37f28-a2e8-4e0a-a9ce-a365ce805e4b@stanley.mountain>
@ 2026-02-06 13:40 ` Dan Carpenter
  2026-02-06 14:28   ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2026-02-06 13:40 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Valentin Schneider, Lorenzo Stoakes, Liam R. Howlett,
	Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
	linux-mm, linux-kernel

[ Smatch checking is paused while we raise funding.  #SadFace
  https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/ -dan ]

Hello Jens Axboe,

Commit 4f08520591a2 ("io_uring: add task fork hook") from Jan 16,
2026 (linux-next), leads to the following Smatch static checker
warning:

	kernel/fork.c:2544 copy_process()
	warn: passing zero to 'ERR_PTR'

kernel/fork.c
  2128  #ifdef CONFIG_IO_URING
  2129          p->io_uring = NULL;
  2130          retval = io_uring_fork(p);

The patch added this assignment.

  2131          if (unlikely(retval))
  2132                  goto bad_fork_cleanup_delayacct;
  2133  #endif
  2134  
  2135          p->default_timer_slack_ns = current->timer_slack_ns;
  2136  
  2137  #ifdef CONFIG_PSI
  2138          p->psi_flags = 0;
  2139  #endif
  2140  
  2141          task_io_accounting_init(&p->ioac);
  2142          acct_clear_integrals(p);
  2143  
  2144          posix_cputimers_init(&p->posix_cputimers);
  2145          tick_dep_init_task(p);
  2146  
  2147          p->io_context = NULL;
  2148          audit_set_context(p, NULL);
  2149          cgroup_fork(p);
  2150          if (args->kthread) {
  2151                  if (!set_kthread_struct(p))
  2152                          goto bad_fork_cleanup_delayacct;

So now retval is success where previously it had been -EAGAIN

  2153          }

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug report] io_uring: add task fork hook
  2026-02-06 13:40 ` [bug report] io_uring: add task fork hook Dan Carpenter
@ 2026-02-06 14:28   ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2026-02-06 14:28 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Valentin Schneider, Lorenzo Stoakes, Liam R. Howlett,
	Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
	linux-mm, linux-kernel

On 2/6/26 6:40 AM, Dan Carpenter wrote:
> [ Smatch checking is paused while we raise funding.  #SadFace
>   https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/ -dan ]
> 
> Hello Jens Axboe,
> 
> Commit 4f08520591a2 ("io_uring: add task fork hook") from Jan 16,
> 2026 (linux-next), leads to the following Smatch static checker
> warning:
> 
> 	kernel/fork.c:2544 copy_process()
> 	warn: passing zero to 'ERR_PTR'
> 
> kernel/fork.c
>   2128  #ifdef CONFIG_IO_URING
>   2129          p->io_uring = NULL;
>   2130          retval = io_uring_fork(p);
> 
> The patch added this assignment.
> 
>   2131          if (unlikely(retval))
>   2132                  goto bad_fork_cleanup_delayacct;
>   2133  #endif
>   2134  
>   2135          p->default_timer_slack_ns = current->timer_slack_ns;
>   2136  
>   2137  #ifdef CONFIG_PSI
>   2138          p->psi_flags = 0;
>   2139  #endif
>   2140  
>   2141          task_io_accounting_init(&p->ioac);
>   2142          acct_clear_integrals(p);
>   2143  
>   2144          posix_cputimers_init(&p->posix_cputimers);
>   2145          tick_dep_init_task(p);
>   2146  
>   2147          p->io_context = NULL;
>   2148          audit_set_context(p, NULL);
>   2149          cgroup_fork(p);
>   2150          if (args->kthread) {
>   2151                  if (!set_kthread_struct(p))
>   2152                          goto bad_fork_cleanup_delayacct;
> 
> So now retval is success where previously it had been -EAGAIN
> 
>   2153          }

Thanks, fixed up.

-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-02-06 14:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <caa37f28-a2e8-4e0a-a9ce-a365ce805e4b@stanley.mountain>
2026-02-06 13:40 ` [bug report] io_uring: add task fork hook Dan Carpenter
2026-02-06 14:28   ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox