lkml.org 
[lkml]   [2008]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] vfs: fix lookup on deleted directory
On Wed, Jul 02, 2008 at 09:30:15PM +0200, Miklos Szeredi wrote:

> Lookup can install a child dentry for a deleted directory. This keeps
> the directory dentry alive, and the inode pinned in the cache and on
> disk, even after all external references have gone away.
>
> This isn't a big problem normally, since memory pressure or umount
> will clear out the directory dentry and its children, releasing the
> inode. But for UBIFS this causes problems because its orphan area can
> overflow.
>
> Fix this by returning ENOENT for all lookups on a S_DEAD directory
> before creating a child dentry.

I wonder if it would be better to do that in a slightly different way:
if ->lookup() returns negative dentry, check if parent is dead and drop
the sucker if it is. OTOH, "no ->lookup() will be ever called for
dead ones" seems to be a nice property and we are on sufficiently slow
path to not worry about the cost of check-and-branch-not-taken, so I'll
probably drop my variant and pick yours instead.


\
 
 \ /
  Last update: 2008-07-02 21:45    [W:0.037 / U:2.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site