From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH review 11/11] mnt: Honor MNT_LOCKED when detaching mounts Date: Thu, 8 Jan 2015 03:11:24 +0000 Message-ID: <20150108031124.GE22149@ZenIV.linux.org.uk> References: <87mw5xq7lt.fsf@x220.int.ebiederm.org> <1420490787-14387-11-git-send-email-ebiederm@xmission.com> <20150107184334.GZ22149@ZenIV.linux.org.uk> <87h9w2gzht.fsf@x220.int.ebiederm.org> <20150107205239.GB22149@ZenIV.linux.org.uk> <87iogi8dka.fsf@x220.int.ebiederm.org> <20150108002227.GC22149@ZenIV.linux.org.uk> <20150108030229.GD22149@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Andrey Vagin , Richard Weinberger , Linux Containers , Andy Lutomirski , linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linus Torvalds To: "Eric W. Biederman" Return-path: Content-Disposition: inline In-Reply-To: <20150108030229.GD22149-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org List-Id: linux-fsdevel.vger.kernel.org On Thu, Jan 08, 2015 at 03:02:29AM +0000, Al Viro wrote: > BTW, why do you use detach_mnt() in __detach_mounts()? Unless I'm missing > something really subtle, __detach_mnt() is the right thing there... > > And while we are at it, all other callers of detach_mnt() are followed by > attach_mnt() within the same namespace *and* all attach_mnt() follow > detach_mnt(). So why bother with mnt_list in either? Or, put it > another way, why have __detach_mnt() separate from detach_mnt()? I really don't like the look of __detach_mounts() after those changes. Suppose we have a single "locked-and-lazy" vfsmount mounted on that dentry. With nothing mounted under it. Your loop will do absolutely nothing to it - it'll just keep spinning. Why are you doing anything to the stuff mounted under than one, anyway? It's this sucker you want to detach and kill... Normal case (umount_tree()) will detach the vfsmount we are giving it; this one should have the same effect...