lkml.org 
[lkml]   [1997]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: patch for 2.1.48 autofs race


On Fri, 8 Aug 1997, Bill Hawes wrote:
>
> I've found a race condition in autofs that could explain some of the
> recent oops reports. In autofs/root.c, after doing a d_add(dentry,NULL)
> there's a nice long pause for revalidation. But since the dentry hasn't
> had its use count incremented, it may be possible for it to be released,
> and after the lookup returns the trashed dentry might get used.
>
> The attached patch bumps d_count around the revalidation to protect the
> dentry.

You're correct.

However, I think it actually would be better to do this at the VFS layer,
and not have the low-level filesystems every know about "dentry counts".
It's bad form by the VFS layer anyway to let dentries with a zero count be
around (except when holding the name lookup spinlock, which I still
haven't gotten around to actually create yet although it should be trivial
to do as the code has been designed with the spinlock in mind).

Linus


\
 
 \ /
  Last update: 2005-03-22 13:40    [W:0.179 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site