From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [2.6.38] Deadlock between rename_lock and vfsmount_lock. Date: Fri, 18 Mar 2011 11:06:03 +0000 Message-ID: <20110318110603.GG22723@ZenIV.linux.org.uk> References: <201103160854.p2G8sR6c077737@www262.sakura.ne.jp> <201103170501.p2H51PjU052428@www262.sakura.ne.jp> <201103181959.CHC73937.SQOLJtVHOMFFOF@I-love.SAKURA.ne.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: npiggin@kernel.dk, linux-fsdevel@vger.kernel.org To: Tetsuo Handa Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:60015 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750919Ab1CRLGF (ORCPT ); Fri, 18 Mar 2011 07:06:05 -0400 Content-Disposition: inline In-Reply-To: <201103181959.CHC73937.SQOLJtVHOMFFOF@I-love.SAKURA.ne.jp> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Mar 18, 2011 at 07:59:08PM +0900, Tetsuo Handa wrote: > I established steps to reproduce. > > On a 2.6.38 kernel built with CONFIG_SMP=y running on an SMP machine, run > > while :; do newns /sbin/pivot_root /proc/ /proc/sys/; done > > on one terminal and run > > while :; do /bin/ls -l /proc/*/exe; done > > on another terminal. (The "newns" is a program that unshares the mnt namespace > before execve() using CLONE_NEWNS.) > > Below patch releases/reacquires vfsmount_lock when rescheduling is required. > --- > fs/dcache.c | 15 ++++++++++++++- > fs/namespace.c | 6 ++++++ > include/linux/sched.h | 2 ++ > include/linux/seqlock.h | 4 ++++ > 4 files changed, 26 insertions(+), 1 deletion(-) That's incredibly ugly. I agree that the deadlock exists and needs to be dealt with, but not that way. _Strongly_ NAKed. I'll see what I can come up with, but that variant is not an option.