Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753674Ab3CVAIH (ORCPT ); Thu, 21 Mar 2013 20:08:07 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:38956 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753345Ab3CVAIF (ORCPT ); Thu, 21 Mar 2013 20:08:05 -0400 Date: Fri, 22 Mar 2013 00:08:03 +0000 From: Al Viro To: Linus Torvalds Cc: Dave Jones , Linux Kernel , "Eric W. Biederman" Subject: Re: VFS deadlock ? Message-ID: <20130322000803.GG21522@ZenIV.linux.org.uk> References: <20130321202635.GA16406@redhat.com> <20130321203639.GC16406@redhat.com> <20130321204704.GZ21522@ZenIV.linux.org.uk> <20130321210255.GD16406@redhat.com> <20130321221256.GA30620@redhat.com> <20130321233630.GE21522@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 967 Lines: 18 On Thu, Mar 21, 2013 at 04:58:41PM -0700, Linus Torvalds wrote: > And the only other reason we don't want to allow it is to make sure > you can't have directory loops etc, afaik, and again, for this > particular case of /proc, we happen to be ok. Not really. Do that and yes, this deadlock goes away. But the locking order in general goes to hell - we order directory inodes by "which dentry is an ancestor of another?" So we have no warranty that we won't get alias1/foo/bar/baz < alias2/foo. Take rename_lock() on those two and have it race with rmdir alias2/foo/bar/baz (locks alias2/foo/bar, then alias2/foo/bar/baz) and rmdir alias2/foo/bar (locks alias2/foo and alias2/foo/bar). Oops - we have a cycle now... -- 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/