lkml.org 
[lkml]   [2021]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH RFC 1/6] dcache: sweep cached negative dentries to the end of list of siblings
On Wed, Apr 14, 2021 at 03:00:48AM +0000, Al Viro wrote:

> Ugh... So when dput() drives the refcount down to 0 you hit lock_parent()
> and only then bother to check if the sucker had been negative in the first
^^^^^^^^^^^^^^^^^
had zero refcount, of course.
> place?

> > @@ -1970,6 +2021,8 @@ void d_instantiate(struct dentry *entry, struct inode * inode)
> > {
> > BUG_ON(!hlist_unhashed(&entry->d_u.d_alias));
> > if (inode) {
> > + if (d_is_tail_negative(entry))
> > + recycle_negative(entry);
> > security_d_instantiate(entry, inode);
> > spin_lock(&inode->i_lock);
> > __d_instantiate(entry, inode);
>
> Wait a bloody minute. What about d_instantiate_new() right next to it?

Another fun question: where's the proof that __d_add(dentry, non_NULL_inode)
won't happen to dentry marked tail-negative? From a quick grep I see at
least one such place - on success cifs_do_create() does
d_drop(direntry);
d_add(direntry, newinode);
and it would bloody well evade what you are doing in d_instantiate().
Same seems to be true for nfs_link()...

\
 
 \ /
  Last update: 2021-04-15 18:51    [W:0.080 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site