Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756870Ab0F3Qs3 (ORCPT ); Wed, 30 Jun 2010 12:48:29 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:45781 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754830Ab0F3Qs1 convert rfc822-to-8bit (ORCPT ); Wed, 30 Jun 2010 12:48:27 -0400 MIME-Version: 1.0 In-Reply-To: <87mxuc91r2.fsf@linux.vnet.ibm.com> References: <20100608004102.GQ31073@ZenIV.linux.org.uk> <87pqzrexon.fsf@linux.vnet.ibm.com> <871vbwe6lp.fsf@linux.vnet.ibm.com> <87mxuc91r2.fsf@linux.vnet.ibm.com> Date: Wed, 30 Jun 2010 09:48:15 -0700 Message-ID: Subject: Re: [V9fs-developer] [GIT PULL] 9p file system bug fixes for 2.6.35-rc2 From: Linus Torvalds To: "Aneesh Kumar K. V" Cc: Eric Van Hensbergen , V9FS Developers , Al Viro , linux-kernel Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1464 Lines: 32 On Wed, Jun 30, 2010 at 4:52 AM, Aneesh Kumar K. V wrote: > > You are correct. we cannot drop the rename lock in between. I also found > another issue in that we are using dentry->d_name.name directly. That > would imply we need to hold the rename_lock even during the > client_walk. Yes. >?How about the patch below ?. I updated the patch to hold > rename_lock during multiple path walk. Also the rename path is updated > to hold the lock during p9_client_rename operations. I'm not finding any obvious problems with this, and you're right that you also need to hold the rename write-lock even for regular renames (not just cross-directory ones) in order to protect the name itself. So those two patches together seem to be ok at a quick glance. That said, I do wonder if you wouldn't be better off copying the name components in order to then drop the lock earlier. That way you'd only need to hold the lock while walking the dentries, and could possibly release it during the actual walk (unless you need the names to be stable, but I don't think you can rely on that anyway, since other clients might be doing renames concurrently.. I don't know) Linus -- 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/