From: Al Viro <viro@ZenIV.linux.org.uk>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: akpm@linux-foundation.org, hch@infradead.org,
Artem.Bityutskiy@nokia.com, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [patch] vfs: fix lookup on deleted directory
Date: Wed, 2 Jul 2008 20:42:50 +0100 [thread overview]
Message-ID: <20080702194249.GV28946@ZenIV.linux.org.uk> (raw)
In-Reply-To: <E1KE81v-0000d8-Kp@pomaz-ex.szeredi.hu>
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.
next prev parent reply other threads:[~2008-07-02 19:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-02 19:30 [patch] vfs: fix lookup on deleted directory Miklos Szeredi
2008-07-02 19:42 ` Al Viro [this message]
2008-07-03 14:33 ` Miklos Szeredi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080702194249.GV28946@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=Artem.Bityutskiy@nokia.com \
--cc=akpm@linux-foundation.org \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.