From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 2/2] vfs: clean up real_lookup Date: Thu, 19 Mar 2009 16:22:19 -0400 Message-ID: <20090319202219.GA32000@infradead.org> References: <1237493790-5665-1-git-send-email-sage@newdream.net> <1237493790-5665-2-git-send-email-sage@newdream.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, hch@infradead.org, akpm@linux-foundation.org To: Sage Weil Return-path: Received: from bombadil.infradead.org ([18.85.46.34]:40774 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753523AbZCSUWW (ORCPT ); Thu, 19 Mar 2009 16:22:22 -0400 Content-Disposition: inline In-Reply-To: <1237493790-5665-2-git-send-email-sage@newdream.net> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Mar 19, 2009 at 01:16:30PM -0700, Sage Weil wrote: > + if (result) { > + /* > + * The cache was re-populated while we waited on the > + * mutex. We need to revalidate, this time while > + * holding i_mutex (to avoid another race). > + */ > + if (result->d_op && result->d_op->d_revalidate) { > + result = do_revalidate(result, nd); > if (result) > + goto out_unlock; > + /* > + * The dentry was left behind invalid. Just > + * do the lookup. > + */ > + } else { > + goto out_unlock; > } This would be better off as if (!result->d_op || !result->d_op->d_revalidate) goto out_unlock; result = do_revalidate(result, nd); if (result) goto out_unlock; /* * The dentry was left behind invalid. Just * do the lookup. */ Otherwise looks good to me.