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 12:52:24 +0000 Message-ID: <20110318125224.GJ22723@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> <20110318110603.GG22723@ZenIV.linux.org.uk> <20110318120748.GH22723@ZenIV.linux.org.uk> 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]:58314 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756267Ab1CRMwZ (ORCPT ); Fri, 18 Mar 2011 08:52:25 -0400 Content-Disposition: inline In-Reply-To: <20110318120748.GH22723@ZenIV.linux.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Mar 18, 2011 at 12:07:48PM +0000, Al Viro wrote: > lock_mount(path, follow) > retry: > lock path->dentry->d_inode > if unlikely(can't mount) > unlock > fail > grab namespace_sem > if !follow || likely(lookup_mnt() returns NULL) > we are done > drop namespace_sem > unlock > drop path > replace it with result of lookup_mnt() (and its ->mnt_root) > goto retry; > > and use that (local to fs/namespace.c) in do_add_mount()/do_move_mount()/ > do_loopback() (with follow = 1) and pivot_root() (follow = 0). BTW, > the lack of following in do_loopback() looks like a bug... So's the lack of following on old in pivot_root, actually. IOW, follow argument is always 1...