Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2551743imm; Mon, 24 Sep 2018 06:18:57 -0700 (PDT) X-Google-Smtp-Source: ACcGV62QwUN0MzP/YQbrv0jrBwV5kvdD3kqkzu1v6OHv7UlSe4rdRJNBSwScI7CkD2b4GTswBOVT X-Received: by 2002:a17:902:9a0c:: with SMTP id v12-v6mr10816118plp.159.1537795137381; Mon, 24 Sep 2018 06:18:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537795137; cv=none; d=google.com; s=arc-20160816; b=sRLekxiyCbUaYubNdSZrqn4ZkYKshVDtPUjSf5k1FvlwfiPveFHsr9XVCRtlclqVpX DWtNVKf+XBWMifFL97cyvtJvwcMTqYmCjmsAqJ6Vyd6LSC6Y6UhDSIsaZpaqK3Rd0WMA 0NGazRGaXbD2t5IJ6XxXga8q6xdITXFt7KfYBqHi2AEQ5NJM/QgOfoTM5EqU0UVQYmie gkLot14Qvtlu5LuAw7zBnBqMEPZfntuJPa0rDOuUbG6E/lNkcXlZJfFnSBRGwxxjmRqL h0UQ0tOY9kKF+eO+5nI+LrPnO6lJfAU+uVb44zy2y2Mr58FT/HxzSaXA1LrOdrSQYhjy RL+g== 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:dkim-signature; bh=1Qla0hf/ZuwJB9W2b8qP9+0liT+B/PNXuD+YQ09ZjwM=; b=I0VUFv8HVFmPalC+oVHPGDeguFSX7zpdBcdEY/3a94CJe2HVd7/YKF8GogBmEA85YR 8AKGkMx0c5Cgw9HsVOTDcz4c4qEiW2rKGfcVFzlp1LoZST61L4z8UawcQ8eTeJmvGrqm y2oVN4xDjn98wy+XZAkLQfJcVuOgP/ksgHef+x7ASggaI+yG49XN2Wcx14UUZ1VyJNBt 1CoricqlAja52qZXSJOPsMnINZCcRkftD5nF+Z7j75oAGNNMFJhjmGF76y3Qw6JokHP6 Rmc3/9D6WKKI6U7v1f+qDrHyMSBYkcV/4B6MlsrDygdA88Kgh+JIJWr+IU9tVugaSnZ0 vlIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brauner.io header.s=google header.b=RZDHWqk5; 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 w188-v6si37084317pfw.307.2018.09.24.06.18.39; Mon, 24 Sep 2018 06:18:57 -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=pass header.i=@brauner.io header.s=google header.b=RZDHWqk5; 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 S1730354AbeIXTUb (ORCPT + 99 others); Mon, 24 Sep 2018 15:20:31 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:44309 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728917AbeIXTUa (ORCPT ); Mon, 24 Sep 2018 15:20:30 -0400 Received: by mail-wr1-f65.google.com with SMTP id v16-v6so19646431wro.11 for ; Mon, 24 Sep 2018 06:18:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brauner.io; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=1Qla0hf/ZuwJB9W2b8qP9+0liT+B/PNXuD+YQ09ZjwM=; b=RZDHWqk5JC6Iq/Faq/F7GnjnbPgXbH3fwhTxG+axWebvAtK+/fTsmpignIcruUoOOn qtf8gICjO58Db92Q57poYmF61Lc1EBXOxfzZrIbrkjUItqzzZ18t1kxECJhK8xAMOHD2 q8IXPGmz1E1CPoXGTw6ABLn+owT9QI76Y+BsosTe21gBL5NP2ZYyRfTd1gfsdJbheM3L ui9fwRZDNW2mY3fIU6HnhGkLR2EjM+nKx1pdAjNaKGvUnN/uWv7Y4nwNqkcqMnLie/y1 iGGPdt+Qm6Ye5NbZtjKJ0pLACB7ZMDh44pYlTdgZD98Al0R9TJNbtkyqxPwdwUjdYhIb JKRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=1Qla0hf/ZuwJB9W2b8qP9+0liT+B/PNXuD+YQ09ZjwM=; b=lBKt1o0jU/8Pt94tXhO4bFd8ysWJrgkVmW0Lz1/2L05GB1gmY09RQEPMV0m7fwZg/T KnGuEOz2H7dfgualGN17EMx6HK5wmdzLVhn5dViFYkgXTXWhB3f2C3FHaAiqBAsVnn0j Sj7/Mi7cgSIO0mWQY+kTiDeAXrv1UXApObyAhz3k5EITWU/GwaxUDZyC2MGuBrWJZFIk WGpKQc3RFVdKI2C+3TqyClcfG27BV49TxDMeDOp7ytdkW2YW9VtmUBPiie2q5YWXAEod lk+VTintrc69SD9l3kW5w86/1SWkCSXtgiE21E4PUTexNsIlqujOL+nE+MB+KBetsJpl uWyA== X-Gm-Message-State: ABuFfojY7FxkZKGfk7zHBYX5gmKWlyP8qlOgmNTPrlI0SfyUT0Lct6Lf U0xzRxsH61yxnV9bOP+EDrbzgg== X-Received: by 2002:a5d:4c49:: with SMTP id n9-v6mr8795920wrt.71.1537795100027; Mon, 24 Sep 2018 06:18:20 -0700 (PDT) Received: from brauner.io (p5097958a.dip0.t-ipconnect.de. [80.151.149.138]) by smtp.gmail.com with ESMTPSA id b22-v6sm11359947wme.48.2018.09.24.06.18.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Sep 2018 06:18:18 -0700 (PDT) Date: Mon, 24 Sep 2018 15:18:16 +0200 From: Christian Brauner To: David Howells Cc: Miklos Szeredi , Al Viro , aviro@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/6] fsmount: do not use legacy MS_ flags Message-ID: <20180924131815.76topcqqh3spyvvp@brauner.io> References: <20180922132106.wfa6xaxwbu276qka@brauner.io> <20180921155455.flkf5vdrm3vgn6do@brauner.io> <20180920151214.15484-6-mszeredi@redhat.com> <20180920151214.15484-1-mszeredi@redhat.com> <17157.1537542475@warthog.procyon.org.uk> <20311.1537548756@warthog.procyon.org.uk> <8221.1537631312@warthog.procyon.org.uk> <3868.1537742717@warthog.procyon.org.uk> <30364.1537771838@warthog.procyon.org.uk> <29956.1537792665@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ouaxp4t3sd3or2bq" Content-Disposition: inline In-Reply-To: <29956.1537792665@warthog.procyon.org.uk> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --ouaxp4t3sd3or2bq Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 24, 2018 at 01:37:45PM +0100, David Howells wrote: > Christian Brauner wrote: >=20 > > I have thought a little more about splitting up the mount flags into > > sensible sets. I think the following four sets make sense: > > > > enum { > > MOUNT_ATTR_PROPAGATION =3D 1, > > MOUNT_ATTR_SECURITY, > > MOUNT_ATTR_SYNC, > > MOUNT_ATTR_TIME, > > }; >=20 > Al (I think it was) has been against splitting them up before (I've previ= ously > proposed splitting the topology propagation flags from the mount attribut= es). Right, that request could probably be fulfilled by the first draft for this idea that I had but didn't send out. Basically, having a sequential enum that only ever gets bumped when we run out of flags in a set, i.e. enum { MOUNT_ATTR_SET_1 =3D 1, MOUNT_ATTR_SET_2 =3D 2, MOUNT_ATTR_SET_3 =3D 3, . . . }; Then we would currently only define a single set enum { MOUNT_ATTR_SET_1 =3D 1, }; dump all the current mount flags we would like to support in there and call it a day until we run out of flags at which point we introduce MOUNT_ATTR_SET_2. But honestly, I find defining cuts by forming sets of logically related flags to be more intuitive and transparent for kernel- and userspace. But I'm just another muppet with an opinion. :) >=20 > > #define MOUNT_ATTR_NOATIME (1<<1) > > #define MOUNT_ATTR_RELATIME (1<<3) > > #define MOUNT_ATTR_STRICTATIME (1<<4) >=20 > These aren't independent, but are actually settings on the same dial, so I > would suggest that they shouldn't be separate flags. I'm not sure about > LAZYTIME though. So what you or Miklos suggested before, namely making them an enum too? >=20 > > enum { > > MOUNT_ATTR_PROPAGATION =3D 1, > > MOUNT_ATTR_SECURITY, > > MOUNT_ATTR_SECURITY_1 =3D MOUNT_ATTR_SECURITY, > > MOUNT_ATTR_SYNC, > > MOUNT_ATTR_TIME, > > MOUNT_ATTR_SECURITY_2, > > }; >=20 > In UAPI headers, always explicitly number your symbols, even in an enum, = just > to make sure that the numbers don't get transparently changed by accident. +1 and thanks for the tip! >=20 > > These flags will likely become AT_* flags or be tied to a syscall > > afaict. > > > > #define MS_REMOUNT 32 > > #define MS_BIND 4096 > > #define MS_MOVE 8192 > > #define MS_REC 16384 >=20 > MS_REMOUNT: fd =3D fspick(); fscommand(fd, FSCONFIG_CMD_RECONFIGURE); >=20 > MS_REMOUNT|MS_BIND: mount_setattr(). >=20 > MS_BIND: fd =3D open_tree(..., OPEN_TREE_CLONE); move_mount(fd, "", ...); >=20 > MS_MOVE: fd =3D open_tree(..., 0); move_mount(fd, "", ...); >=20 > MS_REC: AT_RECURSIVE >=20 > > Internal sb flags will not be part of the new mount attr sets. (They > > should - imho - not be exposed to userspace at all.): >=20 > Agreed. >=20 > > What remains is an odd duck that probably could be thrown into security > > but also *shrug* > > > > #define MS_I_VERSION (1<<23) >=20 > Um. I think it would probably belong with atime settings. >=20 > David --ouaxp4t3sd3or2bq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE7btrcuORLb1XUhEwjrBW1T7ssS0FAluo5BcACgkQjrBW1T7s sS0O5w//UJUVK32uvIzX3Bbr7rxqWvq7kBRP952YMXnbqFhQFVE3C2oLRZ4EE4NT w1N+1MZQ4Rrf7Q5627Z529hyYCe0BfJSHyf3fkGyWX2wvdt1DOQtzW4PSdIFKZ4Z bF9h92cZtHGJwipRkMFZFKbpy93A87QKYrwtTDN1Rz0+OlwEF6vyewVk0gLSjrdw 7CR8OnebLVjquhZXdunbkGkewh4Dz8OHmTWILXzqUEHkVxY62KljzCsuUn+fZsGn y+vKmCWRsTP8JXLzjD6yZqi031uy/LDv5evhQn3tmt9w8kJl5KLUNDaRYUwSmjS/ ih6BPmFp5xcuRdC+eAg2T3A6dgK9fg2nXp4OP7e3JWS89BdzmyYng8H31JXES9l9 tAcK6UZdgOPwSrQY2dhATKS5lnybA3tqa3wcbS/oLuGZxGraU208tRGcfjZiXHVf G2XgWkvdxYY+nSpJdWKTLhQQnyDy+oMCcKp/m8kB1jjAz9HrsuP5TF/OSUnSzJz3 bniuNK6h38UZi8xvF5G8JhFrKLPzclKZog4lguSEt/1EYmLANbZTcj+pC7iZxri8 YEHL20IIcrB+Q98RqCbrOB4lSO0+3ksacLYGky1On9qddvjaa1/Qbn+pNaRjgfAr HrRpQiJ1sw8q2U3iHRN/j3G6+/9dUz5e3DsjSTXwfwGuYMGnurk= =zvds -----END PGP SIGNATURE----- --ouaxp4t3sd3or2bq--