Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6531075pxv; Thu, 29 Jul 2021 17:36:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfjexAB9ayoYRbmG+lRVXj8rRuc7Um5B/lUQfFcTdktdYH+tUlLIkXWPvk2fa0KbQ1pG1W X-Received: by 2002:a05:6602:2406:: with SMTP id s6mr7212ioa.159.1627605370682; Thu, 29 Jul 2021 17:36:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627605370; cv=none; d=google.com; s=arc-20160816; b=Ep8G1vsg4tCU8mwGIvc9SaO7/WQJjdtQ9QRZM6tC93FR6id9gid2WwnksfMIFcqZRc HQTpZLT2lH9jiZ6B68ymLDGHrR9unP7zd/jm4bilmOztu17PKVuo5YMIfk9KXMwZ+TK9 CCs2wzlyczdQTzL1jtpskKwd7gOPHNvXt02ZMUVYRnhBIL/Gw1vP40/gk9eTzjwbPD7v mDryT3RFyNpmTlNqpDUtfj2P6fnKLgoMKRWnFAnK7IILuLZCEsGvpqmhWcrsZGqn1BWb En0Rs5m/+P+F+vc5buLMU8Xpe9vQ4tGAJwig59vwacNLyHzZIUmynhuFSmuiWYeI1i5i sVOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=czQ5j3BYxzfej+UpMNILgoRFP4b6LWyyN26urMoWBgo=; b=uGFB69i1dSCuZhWkkwGgTdK8PI9PreNyN0YgwV05gi0l2X/5dLg3Lu8RbjNVVHxaQg 1LR8IyMiLgokP2SHJCCrroff66vXwcNKRBnORKnklm1eQazrG2FOP07SJk2WITWAV8o5 26252pPy9SYf/06zlqio5jzspfmR6dIPtoD2mq3WYoVuKjrYPS/UF3816Si/OVzM9JJt Apon8v2VQpedD53qS0m7R9d5GC3dsL9O+zZgMNKAd/n/mDAXOaclRv5mcvdKINblGI82 FrKzpsiqxI2YnXMGwpgZEDDh87eB/UWJtmRD2tDj+DDxfSl0+0nPpic1rzF4tNdnxgNW McYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n11si5680251ilt.138.2021.07.29.17.35.58; Thu, 29 Jul 2021 17:36:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235385AbhG3Aes (ORCPT + 99 others); Thu, 29 Jul 2021 20:34:48 -0400 Received: from zeniv-ca.linux.org.uk ([142.44.231.140]:42802 "EHLO zeniv-ca.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229523AbhG3Aer (ORCPT ); Thu, 29 Jul 2021 20:34:47 -0400 Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9GTw-00530D-VC; Fri, 30 Jul 2021 00:34:33 +0000 Date: Fri, 30 Jul 2021 00:34:32 +0000 From: Al Viro To: NeilBrown Cc: Christoph Hellwig , Josef Bacik , "J. Bruce Fields" , Chuck Lever , Chris Mason , David Sterba , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-btrfs@vger.kernel.org Subject: Re: [PATCH 05/11] VFS: new function: mount_is_internal() Message-ID: References: <162742539595.32498.13687924366155737575.stgit@noble.brown> <162742546552.32498.14429836898036234922.stgit@noble.brown> <162744316594.21659.15176398691432709276@noble.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <162744316594.21659.15176398691432709276@noble.neil.brown.name> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, Jul 28, 2021 at 01:32:45PM +1000, NeilBrown wrote: > On Wed, 28 Jul 2021, Al Viro wrote: > > On Wed, Jul 28, 2021 at 08:37:45AM +1000, NeilBrown wrote: > > > This patch introduces the concept of an "internal" mount which is a > > > mount where a filesystem has create the mount itself. > > > > > > Both the mounted-on-dentry and the mount's root dentry must refer to the > > > same superblock (they may be the same dentry), and the mounted-on dentry > > > must be an automount. > > > > And what happens if you mount --move it? > > > > > If you move the mount, then the mounted-on dentry would not longer be an > automount (.... I assume???...) so it would not longer be > mount_is_internal(). > > I think that is reasonable. Whoever moved the mount has now taken over > responsibility for it - it no longer is controlled by the filesystem. > The moving will have removed the mount from the list of auto-expire > mounts, and the mount-trap will now be exposed and can be mounted-on > again. > > It would be just like unmounting the automount, and bind-mounting the > same dentry elsewhere. Once more, with feeling: what happens to your function if it gets called during mount --move? What locking environment is going to be provided for it? And what is going to provide said environment?