From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f65.google.com ([209.85.128.65]:39467 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726616AbeJJU2b (ORCPT ); Wed, 10 Oct 2018 16:28:31 -0400 Subject: Re: [PATCH 03/34] teach move_mount(2) to work with OPEN_TREE_CLONE [ver #12] To: David Howells , viro@zeniv.linux.org.uk Cc: torvalds@linux-foundation.org, ebiederm@xmission.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, mszeredi@redhat.com References: <153754740781.17872.7869536526927736855.stgit@warthog.procyon.org.uk> <153754743491.17872.12115848333103740766.stgit@warthog.procyon.org.uk> <15751.1539176549@warthog.procyon.org.uk> From: Alan Jenkins Message-ID: <63c8d073-8309-82cf-6089-ef805feb9fae@gmail.com> Date: Wed, 10 Oct 2018 14:06:22 +0100 MIME-Version: 1.0 In-Reply-To: <15751.1539176549@warthog.procyon.org.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 10/10/2018 14:02, David Howells wrote: > The attached change seems to fix the lazy-umount problem. > > David > --- > diff --git a/fs/namespace.c b/fs/namespace.c > index 5adeeea2a4d9..d43f0fa152e9 100644 > --- a/fs/namespace.c > +++ b/fs/namespace.c > @@ -2472,7 +2472,7 @@ static int do_move_mount(struct path *old_path, struct path *new_path) > if (old->mnt_ns && !attached) > goto out1; > > - if (old->mnt.mnt_flags & MNT_LOCKED) > + if (old->mnt.mnt_flags & (MNT_LOCKED | MNT_UMOUNT)) > goto out1; > > if (old_path->dentry != old_path->mnt->mnt_root) I can't test any more at the moment, as my laptop died today :). But I have no objection to this. It would be more fun if there was a way to support it :), but I don't have a genuine reason to want it.  And you couldn't use it for fully general purposes anyway, because umount2( , MNT_DETACH) is defined as separating all the child mounts. P.S. Regarding the issue with the namespace loop.  My strawman solution would be for graft_tree() to silently detach any NS file mounts that have a sequence number less than or equal to the namespace they are being mounted into.