lkml.org 
[lkml]   [2022]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 01/10] kernfs: Remove reference counting for kernfs_open_node.
On Tue, Apr 26, 2022 at 08:13:22PM +0000, Al Viro wrote:
> On Tue, Apr 26, 2022 at 08:29:21AM -1000, Tejun Heo wrote:
>
> > The code is just wrong. You can end up:
> >
> > on = kn->attr.open;
> > if (!on)
> > return;
> >
> > // we get preempted here and someone else puts @on and then
> > // recreates it
>
> Can't happen - the caller has guaranteed that no new openers will be
> coming. Look at the call chain of kernfs_drain_open_files()...

Ah, okay. It can only transition to NULL from there. It's still a weird way
to go about it tho.

Thanks.

--
tejun

\
 
 \ /
  Last update: 2022-04-26 22:18    [W:0.054 / U:0.800 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site