Re: [PATCH v2] sched/psi: fix race between file release and pressure write
From: Tejun Heo
Date: Sat Apr 11 2026 - 16:40:24 EST
Hello,
On Sat, Apr 11, 2026 at 04:29:22PM +0800, Edward Adam Davis wrote:
> On Fri, 10 Apr 2026 21:39:49 -1000, Tejun Heo wrote:
> > > > > + ctx = of->priv;
> > > > > + if (!ctx) {
> > > >
> > > > This test likely isn't necessary but that's pre-existing.
> > > Where?
> > > Are you referring to the check for of->released within:
> >
> > No, I'm talking about of->priv. I don't think it can be NULL while a live
> > cgroup kn is locked, can it?
>
> If the lock is acquired before the execution of cgroup_file_release()
> completes, it will not be NULL; however, if acquired afterwards, it
> will invariably be NULL.
Hmmm? While the write is in flight the file can't be released and the cgroup
couldn't have been dead if lock_live succeeded. This part is tangential
anyway. Let's ignore for now.
Thanks.
--
tejun