Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp897750imm; Wed, 10 Oct 2018 06:08:25 -0700 (PDT) X-Google-Smtp-Source: ACcGV62h2TvPVCMXgKviu08iqqrG1mDNpALIEgdPApQHaImvskKTnK7v839QMT2AzMOYRTJirtkL X-Received: by 2002:a63:4a64:: with SMTP id j36-v6mr29770686pgl.168.1539176905195; Wed, 10 Oct 2018 06:08:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539176905; cv=none; d=google.com; s=arc-20160816; b=Oglmpp4qDtO95ZqstKZo6Uo6ulBjCPYUwh7+jEkKj4BacUJSpXZPLJHA3kHuf775zg 2RvXE2NZnUsARNv+IhaY1to2k4t4YNaszYgOydah8TaooF/AnBIt91x65mGGQEzHN1aQ xVchBzpVCVt6RatOjVeUabennpzRdAiTc1JVhnaDPauwYrZdWAeAywxyXJAPENIC+7RW iSYvt1a9XD0YkGBT3bXnbCaX72R9d+OIDbUmfkFcyb9s+lGtdohTRNIYkPB3HU/XivOU YtwHf6h2FqWdTRVJIeLtoFg0uE2o6DvZkvFw7LxxVYiRZBIyZw26LijVhxN8Q3Rrqhox dagA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=xo81FGVxUpGzKKvCPBbOO7/8bRD39uGZQLZ6C5DXp0Y=; b=FslkPKJEvRSwtJF7I9PZiH9N+CG5WeS8jD6gvYh/DlzbhfvwBSDF/1jTKj/fp3tKv1 kKR6s7ZQrzokFOZMcU1qQqpWtlRebyEJGwXWcKl0U0sACv26G6mjm5mAMmTdrh2WLV/B Tw/bI263zYEQBkmeZVj/0m7QhZxWSxnwFbBrsMxMz8fB8E8kB/rWqCqnDCTETHbY8Epe 6h/neBBTOq9aM1OBLE1xczPf3mnOcxT31rGiEtM106oVAgNeYBY/602ClKlTyildVGg8 1zCHZYyN+8iseAS5nkFXmEIusomvn2VnfdN3lGGDo92jrE8OMkEBwYRXroa4aI1GgpSd 5Mtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rKXSfycM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g34-v6si25701453pld.325.2018.10.10.06.07.39; Wed, 10 Oct 2018 06:08:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rKXSfycM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726910AbeJJU2c (ORCPT + 99 others); Wed, 10 Oct 2018 16:28:32 -0400 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 Received: by mail-wm1-f65.google.com with SMTP id y144-v6so5644621wmd.4; Wed, 10 Oct 2018 06:06:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=xo81FGVxUpGzKKvCPBbOO7/8bRD39uGZQLZ6C5DXp0Y=; b=rKXSfycMbyp7o0hsaAuB5w7GZJfXf8iyMcmNxYJ3OrGGJqJsyk8E9CForTN6DTrk2X oT74D3G+tzxoW05IwribmKfiLgYJox3ZKmPR0awcIlZ+SgcEJ6+QGnrlGxXixC2znOtm WVLrdUKa+6tqPA45KhlFjtZTfjbURyTT3xhHqKvJ+lEbKmORHrOW8mSaiS59/XL8tPS8 wEYErT5CfZo8V/n5rA2DcDrCoEkhJTmgLN3qtPxdxGgzVF1U1w0je+fQOpQw6Fscz9wL Wy3CxurqFbrteuIO0kKZ3uj7xAF2ELafSsDqk1G9mwrJmp6oKs+TOlfjrTIfjuBKYDy6 2oFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=xo81FGVxUpGzKKvCPBbOO7/8bRD39uGZQLZ6C5DXp0Y=; b=M/fXNrTbcCvHllTDktRFcGll4C8ZMcoeF5RLURNiGgcIInKAZdy5OVs9vu6enKNumT WZRwLbVg5z2K/3Ar1bVwdUPQKnlPHPqWDast1ID2Hiz52uoOyDzNxq+jUYmHc2x3Fm6V nbO5iezFjVEnhQts3MzwMgw6vDv37OVl5gk5rrnZfdRAhvn9PUNN+qJyxKeBMvPqmKUe BkZZ3RVvQ7V9y6mB3GFc7Wi2u5yI/kit2bBu/QqUKlWwsGWimxfIXsABiKqgHzCWSUFu /OS8yX4R0kNTVhBz1s7xpSwufuvZGlvLh0QZAtmPM4BDda9UEetBQ5lp0QWtL8eJw0/S W82Q== X-Gm-Message-State: ABuFfoiU232j80O+3H2ridFhoHZZkjpFcdXeLKSDcxKjw+u1qVfkJUYe FxILdqkEJuNmEzb4h5QIbaA= X-Received: by 2002:a1c:4d0b:: with SMTP id o11-v6mr884491wmh.94.1539176784357; Wed, 10 Oct 2018 06:06:24 -0700 (PDT) Received: from [172.16.1.10] (host-89-243-172-161.as13285.net. [89.243.172.161]) by smtp.gmail.com with ESMTPSA id c184-v6sm13464308wma.15.2018.10.10.06.06.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Oct 2018 06:06:23 -0700 (PDT) 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 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.