Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5691929pxv; Wed, 28 Jul 2021 17:44:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsWG95UOhkEEZ5GPkCRxUi4MXO2p6RcU5zLfS0ax0k1ZstLYSo4Sbp1UUtZNQXx6P9OyJa X-Received: by 2002:a92:db4e:: with SMTP id w14mr1789278ilq.188.1627519441378; Wed, 28 Jul 2021 17:44:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627519441; cv=none; d=google.com; s=arc-20160816; b=MYuulYOhCdv7fn/xaD0FKjyi5ta30hJjgXGxPyZiS0sZe9SVF8TULShLaqZVmun8mk AvinTqx5/1Vry8cuFnyEBlKwiDEoV+DXnTQNV4MeC2x07k0HbsgAOJgvXffXEz8s+8xE vEcAAMoacXul2omd6Yim94GZ0YEb1Hz6I0sv4tfB9nDWbxbpO90TxmCsle5+0bFgTA2H EFi01qBcC8O98aniWshzVFy7erJYPR1tOyFf0FQftadBauIe73Pi2kI1e0wsvE9aUY7Y SxTotf6E+UsFlZBeqfeL7QrtIY0dxNRzwvQ8oM7O946IkX+Y20YMMsURSX6FQclnDfto moIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=9FTxaVEoSr+Xax9oo8ainK5PQyM3hdeesRBkvIyazV4=; b=nOoak39NA4DJqr8tIGH+V9bP7VlVBrMd/lUDeef7tkVViIRTJXQoBxuzq3z5K69YFn 6T4wFlh5kacD/6W31BPP87Y36VC/bVmvCTvdksXabDxlQKLNndXFQscXI0DIFg9pHlZe M/QNZDeR2lvJNEFMmozjCQ9OEr+LRp8TogTryEoPERdpHuvnXVm5qZgB2f5OBUV8MdIa lJ1d15g47WWYaoZwxRUfFVSQiE4um6o2Vab3cVTd1THOftUrfKxlM3Q9FYWUKQ5yckNV 7l4ymWxNkdp+OzS62nvZoMOTVJ8XjvJhXp0k14LSnTyNT7LZD1DBO6hvw/asXBXVgigl CWSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=W9wlJWXz; dkim=neutral (no key) header.i=@suse.de; 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 g14si1626949jaj.31.2021.07.28.17.43.38; Wed, 28 Jul 2021 17:44:01 -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; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=W9wlJWXz; dkim=neutral (no key) header.i=@suse.de; 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 S232904AbhG2Ang (ORCPT + 99 others); Wed, 28 Jul 2021 20:43:36 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:37822 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232837AbhG2Anf (ORCPT ); Wed, 28 Jul 2021 20:43:35 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id D57D9201C9; Thu, 29 Jul 2021 00:43:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1627519409; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9FTxaVEoSr+Xax9oo8ainK5PQyM3hdeesRBkvIyazV4=; b=W9wlJWXzPR+NSH1Nlf6q1itAzldXvOmGDkR5jNm/RGZTHOobLrplYXH3plCNOkhZYK8ueT 7IjlWyTvkjD3pg2Z5pdoE5ieVlsjQMA481XiRuDVRgwyMLtHoi/XqTrmYC/RmAgt9SAFj4 VVJKKVWHTjsuWDpNPjNABwCJttMofHc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1627519409; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9FTxaVEoSr+Xax9oo8ainK5PQyM3hdeesRBkvIyazV4=; b=EVvHY4aO5lhaDw4izAyUO0sTU/eMKgNCQKhuaPDQoXb88K2Dn9kj/sUKLBFs8zziiHQErn ooO4YByS5QcKWXDw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id ABEEA13ADC; Thu, 29 Jul 2021 00:43:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id dBNrGq75AWHvfgAAMHmgww (envelope-from ); Thu, 29 Jul 2021 00:43:26 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "NeilBrown" To: "Christian Brauner" Cc: "Christoph Hellwig" , "Josef Bacik" , "J. Bruce Fields" , "Chuck Lever" , "Chris Mason" , "David Sterba" , "Alexander Viro" , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-btrfs@vger.kernel.org Subject: Re: [PATCH 11/11] btrfs: use automount to bind-mount all subvol roots. In-reply-to: <20210728131213.pgu3r4m4ulozrcav@wittgenstein> References: <162742539595.32498.13687924366155737575.stgit@noble.brown>, <162742546558.32498.1901201501617899416.stgit@noble.brown>, <20210728131213.pgu3r4m4ulozrcav@wittgenstein> Date: Thu, 29 Jul 2021 10:43:23 +1000 Message-id: <162751940386.21659.17682627731630829061@noble.neil.brown.name> Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, 28 Jul 2021, Christian Brauner wrote: > > Hey Neil, > > Sorry if this is a stupid question but wouldn't you want to copy the > mount properties from path->mnt here? Couldn't you otherwise use this to > e.g. suddenly expose a dentry on a read-only mount as read-write? There are no stupid questions, and this is a particularly non-stupid one! I hadn't considered that, but having examined the code I see that it is already handled. The vfsmount that d_automount returns is passed to finish_automount(), which hands it to do_add_mount() together with the mnt_flags for the parent vfsmount (plus MNT_SHRINKABLE). do_add_mount() sets up the mnt_flags of the new vfsmount. In fact, the d_automount interface has no control of these flags at all. Whatever it sets will be over-written by do_add_mount. Thanks, NeilBrown