Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp630305imm; Fri, 10 Aug 2018 19:03:01 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwwP1q3crtweWMlczvJXFoEyWwUFZw6F/OXyX6/hVuNxqiZ8Y+KXMxeXLBqcwunkD9BDUaX X-Received: by 2002:a17:902:b28b:: with SMTP id u11-v6mr8199416plr.2.1533952981759; Fri, 10 Aug 2018 19:03:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533952981; cv=none; d=google.com; s=arc-20160816; b=soGx4BTlDZYFaK2/r1hhbD6eH7PAspO0udohvol3v98EOEI3PHwaVVQCFZ9CfBKdmw SuStX28M3rSVEuH4VxP+Xsu2UiV+Z0PHZwINoLUTTpl2p2eHnqENfzwPO07qKhJJrKOn qBA8uDNjIwpZB+EHF1w1gM7ZNIVC30jQR1XlRruvEbghuO/qaG00lemJgtpivehYyLjo 3Wjd91BFg+ajt8pmmUKqhBYlp7L1Zba9FTh3O4x67CiIXPco49MzIznNgthLIkG7L2oV UaI/5RrMbCLa/hX0/dUTC9FxsFZJURCP6h9zQfBk0DKLxlMuXBfHPNm0cG6NAAajfpV2 qM6w== 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:arc-authentication-results; bh=CDCfulVuXPBRzVsHHsACbqtplcBgmwPwAa+mzwXIVzA=; b=xeXqD+fczky54ZeSjRLRZwZk0c97eQG5HWGGi0oATeLu46f64f5d10E5fujHJHM0lI YtViQAK276BzsnDkuA48Wi+4p9KGxC+mvTNrKg9yun5xC+iOHpvdDxWi76S2uVBAe9U8 8dYsZB9p1XiQaUJhwk3sOzpk9O3zXDdhiHmInWwzBLEXrxc0DS5bqCKik+UbNsA/hgXG ef2jrHYdig2hLNKfCV+WpcFsBPdpxfa6M9I+RAs3Yo1qXBNrYDLyzTVbp7B/sBTJI+FV m7/OVTosKI0eJ2o76q7btKn0Yk1jnG6m8igwWnPzjoaniRTYlRAy3L65zxE8zx/hWnRd i8nQ== 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 bc6-v6si6618185plb.115.2018.08.10.19.02.22; Fri, 10 Aug 2018 19:03:01 -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; 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 S1727242AbeHKEbF (ORCPT + 99 others); Sat, 11 Aug 2018 00:31:05 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:60002 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725882AbeHKEbF (ORCPT ); Sat, 11 Aug 2018 00:31:05 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1foJAV-0008D5-9n; Sat, 11 Aug 2018 01:58:15 +0000 Date: Sat, 11 Aug 2018 02:58:15 +0100 From: Al Viro To: "Eric W. Biederman" Cc: David Howells , John Johansen , Tejun Heo , selinux@tycho.nsa.gov, Paul Moore , Li Zefan , linux-api@vger.kernel.org, apparmor@lists.ubuntu.com, Casey Schaufler , fenghua.yu@intel.com, Greg Kroah-Hartman , Eric Biggers , linux-security-module@vger.kernel.org, Tetsuo Handa , Johannes Weiner , Stephen Smalley , tomoyo-dev-en@lists.sourceforge.jp, cgroups@vger.kernel.org, torvalds@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, "Theodore Y. Ts'o" , Miklos Szeredi Subject: Re: BUG: Mount ignores mount options Message-ID: <20180811015815.GD6515@ZenIV.linux.org.uk> References: <153313703562.13253.5766498657900728120.stgit@warthog.procyon.org.uk> <87d0uqpba5.fsf@xmission.com> <20180810151606.GA6515@ZenIV.linux.org.uk> <87pnypiufr.fsf@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87pnypiufr.fsf@xmission.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 10, 2018 at 08:05:44PM -0500, Eric W. Biederman wrote: > All I proposed was that we distinguish between a first mount and an > additional mount so that userspace knows the options will be ignored. For pity sake, just what does it take to explain to you that your notions of "first mount" and "additional mount" ARE HEAVILY FS-DEPENDENT and may depend upon the pieces of state userland (especially in container) simply does not have? One more time, slowly: mount -t nfs4 wank.example.org:/foo/bar /mnt/a mount -t nfs4 wank.example.org:/baz/barf /mnt/b yield the same superblock. Is anyone who mounts something over NFS required to know if anybody else has mounted something from the same server, and if so how the hell are they supposed to find that out, so that they could decide whether they are creating the "first" or "additional" mount, whatever that might mean in this situation? And how, kernel-side, is that supposed to be handled by generic code of any description? While we are at it, mount -t nfs4 wank.example.org:/foo/bar -o wsize=16384 /mnt/c is *NOT* the same superblock as the previous two. > I don't know how the above wound up being construed as asking that the > code call sget directly but that is what has happened. Not by me. What I'm saying is that the entire superblock-creating machinery - all of it - is nothing but library helpers. With the decision of when/how/if they are to be used being down to filesystem driver. Your "first mount"/"additional mount" simply do not map to anything universally applicable. > > Having something like a second callback for mount_bdev() that would > > be called when we'd found an existing instance for the same block > > device? Sure, no problem. Having a helper for doing such comparison > > that would work in enough cases to bother, so that different fs > > could avoid boilerplate in that callback? Again, more power to you. > > Normal forms etc. If we want to do that it just requires a wee bit of > discipline. And if all of the option parsing is being rewritten and > retested anyway I don't see why we can't do something like that as well. > So it does not sound unreasonable to me. See above.