Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp193638imm; Fri, 10 Aug 2018 09:41:26 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwGryqHvs9qPuVw1Uour4wQC/QiRbTg8S4uKpm0en0k69TicEHYXUhqNKmSjcv9ogSGXUGs X-Received: by 2002:a62:8a4f:: with SMTP id y76-v6mr7820493pfd.233.1533919286636; Fri, 10 Aug 2018 09:41:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533919286; cv=none; d=google.com; s=arc-20160816; b=Iji2jwLdbk0FsOtnZfP2hM4gYaMuA1yEpU6gngi7HIIBnKWHQLIZfkRSrFH6G/wREa LZZhzKSBxLk1HvrlDsp4krC6PqIWAu298GYqFZ67j7jo62CPbqIqmnYQTV/pkC5DT4oR gUBw9AJKkJHlTwo+E9s/Q+uYte3kUgWybad83+cUzuCPt1f9oPPY221Nvp3gWLtBOP71 RjLWQZJ7X/jNIQeOykMC1Bbn2WbVlsEw/kEZjYyE07J0hWSIsdiz/k4yBPMagotXrwuR 9YHK8uJhVSUoWLTAJoH7O9MYEHSv6tH6/UifU+wYT9Vx4Yj5wI5QxNNgeOFOHpPkr3PG 6PVg== 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:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=Pz/6tKnuLzpE5nK588kIUmaUNkjM5HG+kYWHqQtNSA8=; b=KoIW3Ivy7OO9eiigIa2ZaKxfNMKmJtIJJ0si12fNsD7o7pfrMq1Hccf7SmFg4px72Y tsmH60iGsSZWxDoOryA912zV2d5OimrFp0FVgrVLlGIZDHHNmFzJ0P+BS2c1MXqnTydD GpIxhczJII8Cl/3rgeSzjt1Ga1f1Y1ulOrfv++vNJQuw5wWb/AcXLcvssi8sG8STRABJ g/m58i+YFYLSHlKTiWan2cFCNnoIT4xZ/8Hiy7zQrsXdS1KWW61XRHLev6QvVjQ6Gg8A r/RP9KgzPqQwG7lnqF87l2K+oL57g4vykbGOQRQjg6aaU/qX1zDuahd01gdwLdgdAAoS 0yxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@thunk.org header.s=ef5046eb header.b=O55kWoXW; 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 r10-v6si10972568pgm.535.2018.08.10.09.41.11; Fri, 10 Aug 2018 09:41:26 -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=fail header.i=@thunk.org header.s=ef5046eb header.b=O55kWoXW; 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 S1728017AbeHJSJv (ORCPT + 99 others); Fri, 10 Aug 2018 14:09:51 -0400 Received: from imap.thunk.org ([74.207.234.97]:59400 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727408AbeHJSJv (ORCPT ); Fri, 10 Aug 2018 14:09:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=thunk.org; s=ef5046eb; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Pz/6tKnuLzpE5nK588kIUmaUNkjM5HG+kYWHqQtNSA8=; b=O55kWoXWdCcAX/OpdGAlTtiD7c /GcPiJEjqpP9L8X82wEPwnRkO20gVIriOjilKves1QUYT0OFG9fJ3H/dFWC53DUi5T1pqMrzVODrh DTBmR5OWJpp43gd+i8WYjxd+PXqd1qHYS1h885+3AEfesj8zyaYbIvT8Cbt44ETbF9UU=; Received: from root (helo=callcc.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.89) (envelope-from ) id 1fo9VH-0001fW-OJ; Fri, 10 Aug 2018 15:39:03 +0000 Received: by callcc.thunk.org (Postfix, from userid 15806) id 080757A570B; Fri, 10 Aug 2018 11:39:02 -0400 (EDT) Date: Fri, 10 Aug 2018 11:39:02 -0400 From: "Theodore Y. Ts'o" To: David Howells Cc: "Eric W. Biederman" , viro@zeniv.linux.org.uk, 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, Miklos Szeredi Subject: Re: BUG: Mount ignores mount options Message-ID: <20180810153902.GH21087@thunk.org> Mail-Followup-To: "Theodore Y. Ts'o" , David Howells , "Eric W. Biederman" , viro@zeniv.linux.org.uk, 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, Miklos Szeredi References: <87d0uqpba5.fsf@xmission.com> <153313703562.13253.5766498657900728120.stgit@warthog.procyon.org.uk> <22361.1533913891@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <22361.1533913891@warthog.procyon.org.uk> User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false 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 04:11:31PM +0100, David Howells wrote: > > Yes. Since you *absolutely* *insist* on this being fixed *right* *now* *or* > *else*, I'm working up a set of additional patches to give userspace the > option of whether they want no sharing; sharing, but only with exactly the > same parameters; or to ignore the parameter differences and just accept > sharing of what's already already mounted (ie. the current behaviour). But there's no way to support "no sharing", at least not in the general case. A file system can only be mounted once, and without file system support, there's no way for a file system to be mounted with the bsddf or minixdf mount simultaneously. Even *with* file system support, there's no way today for the VFS to keep track of whether a pathname resolution came through one mountpoint or another, so I can't do something like this: mount /dev/sdXX -o casefold /android-data mount /dev/sdXX -o nocasefold /android-data-2 Which is a pity, since if we could we could much more easily get rid of the horror which is Android's wrapfs... So if the file system has been mounted with one set of mount options, and you want to try to mount it with a conflicting set of mount options and you don't want it to silently ignore the mount options, the *only* thing we can today is to refuse the mount and return an error. I'm not sure Eric would really consider that an improvement for the container use case.... - Ted P.S. And as Al has pointed out, this would require special, per-file system support to determine whether the mount options are conflicting or not....