Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3242324ybc; Thu, 14 Nov 2019 06:15:51 -0800 (PST) X-Google-Smtp-Source: APXvYqwcUIqBEtePtDHAGwuqaU59YYrMkF8Ef8ilB15OP8K70xLvmYwMHQY7OS3NlhVIs1iMMcja X-Received: by 2002:a50:ff19:: with SMTP id a25mr1472602edu.181.1573740951000; Thu, 14 Nov 2019 06:15:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573740950; cv=none; d=google.com; s=arc-20160816; b=saEWgvA+mpZlNaY+4pCql2m15GviF0gTtNvsbLWuuWKeA7EfLM4FrgMD84h2A+Q/8d z1MpZUGCcRcZWF3haH/4lqXWHunBdFn3StMaoTtlQqXkUbCoFd3s68S3AraOKh9QInyZ pzvBI4i6MX+MQtqR4fXa3nWW259rBbuTS0o3LMep2w0ufmV6cc3kQUmNZjC3b1Tliftd AAuI925+6gzSBSRs4PLICRqkOK7hAm2/KqyEHUfuOxAunxiUl8HqPRpfKoWh6uylvq7p VSWNT/lM2cdtIB/+7osb3Ya5RQy0UV/Fy/gsWzziHooK3P6tpCbXE2TG4oIfwCD9VbG+ i6Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=lqMRvJ1sv+ThQyHKYZ8QMOFfQKMQyjZ5sz6RGfgZ/MI=; b=P9jRSUSKoSpMLQFA4ADF1nD6IBZ7MWScQ64yjq1qkwP5NlNfG+9l8VgWmqNFsPJFyp V00ykUOG932cTUKdzg7ZScJskpAWc/O/fb6lsWVvRpI+993sBDThvKjMsdOPVxIUYvUb uaoDnoepOqG4vjT/PigkcLSx7mldp/IYXPtHqMzazqDn64rOOSaRrHAZj+q8R0G5ZW2E gQnZRP9g+tG5+8zmVQsj/50aJUleqEE+X2kHJ1n/H0cJyCrvjEqo0yxEdrC0lrs6+8LT rb9/XgZDVgL8HNTP8+Y0EUGqCGvZ8p5cJNxatrNDHZQffo7gfdfKHJu33zQ/JbLA5wSV U2Qg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w27si4175739eda.296.2019.11.14.06.15.25; Thu, 14 Nov 2019 06:15:50 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727388AbfKNONb (ORCPT + 99 others); Thu, 14 Nov 2019 09:13:31 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:40268 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727341AbfKNONa (ORCPT ); Thu, 14 Nov 2019 09:13:30 -0500 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVFs8-0004Zd-4C; Thu, 14 Nov 2019 14:13:20 +0000 Date: Thu, 14 Nov 2019 14:13:20 +0000 From: Al Viro To: Pavel Tikhomirov Cc: Jeff Layton , "J . Bruce Fields" , Arnd Bergmann , Paul Moore , Richard Guy Briggs , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Andrei Vagin Subject: Re: [PATCH v2] fs: add new O_MNT flag for opening mount root from mountpoint fd Message-ID: <20191114141320.GI26530@ZenIV.linux.org.uk> References: <20191114090454.27903-1-ptikhomirov@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191114090454.27903-1-ptikhomirov@virtuozzo.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 14, 2019 at 12:04:54PM +0300, Pavel Tikhomirov wrote: > More precisely the algorithm is: > a) openat mpfd to a new mountpoint through parent mount's root - > p_rootfd (which we already have) or mountpoint fd under a sibling mount > - s_mpfd if our mountpoint is already overmounted. > b) create a new mount on mpfd via /proc//fd/ interface > c) openat it's rootfd via O_MNT from mpfd > > If we have mpfd and rootfd for each mount through /proc//fd/ > interface we will be able to bindmount any part of each of already > created mounts to restore other mounts and we will be able to configure > mounts, e.g. change sharing or other options even if mounts are > invisible from fs-root. Everything else aside (and I'm not thrilled about the idea in general), you are not handling the situation when that overmount is, in turn, overmounted. Or when there's an automount set on top of it, etc.