[Ocfs2-devel] [PATCH] Track negative dentries
Mark Fasheh
mfasheh at suse.com
Tue Jun 22 09:53:42 PDT 2010
On Tue, Jun 22, 2010 at 11:23:33AM +0800, Wengang Wang wrote:
> Actually I meant two dentries in the two run of 'ls -l'.
> At the first run, a dentry, dentry A, is created. Because fileA doesn't exist,
> dentry->d_inode is NULL.
Ok so you do a lookup on a name which doesn't exist, which results in a
negative dentry for fileA.
> Then a do_revalidate() is run, ocfs2_dentry_revalidate() returns "not
> valid" since d_inode is NULL. Thus the dentry A is unhashed from cache by
> d_invalidate().
Part of the patch is to change this behavior right here.
ocfs2_dentry_revalidate() is seeing the NULL inode and forcing the dentry to
be invalidated (thus requiring another lookup).
The patch needs to handle this by comparing sequence numbers with the parent
dentry and ONLY if they're different should it force the dentry to be
invalidated. Otherwise it can allow the dentry to stay hashed (and
negative).
--Mark
--
Mark Fasheh
More information about the Ocfs2-devel
mailing list