Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754759AbZCQIRv (ORCPT ); Tue, 17 Mar 2009 04:17:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752609AbZCQIRe (ORCPT ); Tue, 17 Mar 2009 04:17:34 -0400 Received: from bombadil.infradead.org ([18.85.46.34]:36608 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752481AbZCQIRc (ORCPT ); Tue, 17 Mar 2009 04:17:32 -0400 Date: Tue, 17 Mar 2009 04:17:30 -0400 From: Christoph Hellwig To: Sage Weil Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, viro@zeniv.linux.org.uk, adilger@sun.com Subject: Re: [PATCH] vfs: make real_lookup do dentry revalidation with i_mutex held Message-ID: <20090317081730.GA20213@infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1050 Lines: 30 Keeping i_mutes over do_revalidate seem fine from a first glance, but can you please do it without rearranging the whole code? Something like the tiny untested patch below should archive the same thing: Index: linux-2.6/fs/namei.c =================================================================== --- linux-2.6.orig/fs/namei.c 2009-03-17 09:15:53.430978739 +0100 +++ linux-2.6/fs/namei.c 2009-03-17 09:16:19.553981306 +0100 @@ -512,12 +512,12 @@ out_unlock: * Uhhuh! Nasty case: the cache was re-populated while * we waited on the semaphore. Need to revalidate. */ - mutex_unlock(&dir->i_mutex); if (result->d_op && result->d_op->d_revalidate) { result = do_revalidate(result, nd); if (!result) result = ERR_PTR(-ENOENT); } + mutex_unlock(&dir->i_mutex); return result; } -- 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/