Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757148AbYGBTnS (ORCPT ); Wed, 2 Jul 2008 15:43:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752218AbYGBTm7 (ORCPT ); Wed, 2 Jul 2008 15:42:59 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:52161 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751302AbYGBTm6 (ORCPT ); Wed, 2 Jul 2008 15:42:58 -0400 Date: Wed, 2 Jul 2008 20:42:50 +0100 From: Al Viro To: Miklos Szeredi 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 Message-ID: <20080702194249.GV28946@ZenIV.linux.org.uk> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1249 Lines: 25 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/