Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751936AbdGEQmT (ORCPT ); Wed, 5 Jul 2017 12:42:19 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:41449 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751756AbdGEQmR (ORCPT ); Wed, 5 Jul 2017 12:42:17 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: David Howells Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org References: <149926824154.20611.6104595541055328700.stgit@warthog.procyon.org.uk> Date: Wed, 05 Jul 2017 11:34:28 -0500 In-Reply-To: <149926824154.20611.6104595541055328700.stgit@warthog.procyon.org.uk> (David Howells's message of "Wed, 05 Jul 2017 16:24:01 +0100") Message-ID: <87tw2qetbf.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1dSnNX-0005N0-LP;;;mid=<87tw2qetbf.fsf@xmission.com>;;;hst=in02.mta.xmission.com;;;ip=67.3.213.87;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX19rYzhvEtGxp4oxev7EaGEi7v7Jemkpj4A= X-SA-Exim-Connect-IP: 67.3.213.87 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.7 XMSubLong Long Subject * 1.5 XMNoVowels Alpha-numberic number with no vowels * 1.5 TR_Symld_Words too many words that have symbols inside * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa05 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_03 6+ unique symbols in subject * 0.0 T_TooManySym_05 8+ unique symbols in subject * 0.0 T_TooManySym_02 5+ unique symbols in subject * 0.0 T_TooManySym_01 4+ unique symbols in subject * 0.0 T_TooManySym_04 7+ unique symbols in subject X-Spam-DCC: XMission; sa05 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ***;David Howells X-Spam-Relay-Country: X-Spam-Timing: total 342 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 2.4 (0.7%), b_tie_ro: 1.63 (0.5%), parse: 0.81 (0.2%), extract_message_metadata: 4.2 (1.2%), get_uri_detail_list: 2.6 (0.7%), tests_pri_-1000: 3.2 (0.9%), tests_pri_-950: 1.10 (0.3%), tests_pri_-900: 0.88 (0.3%), tests_pri_-400: 32 (9.3%), check_bayes: 31 (9.0%), b_tokenize: 14 (4.1%), b_tok_get_all: 9 (2.6%), b_comp_prob: 2.8 (0.8%), b_tok_touch_all: 3.1 (0.9%), b_finish: 0.64 (0.2%), tests_pri_0: 286 (83.4%), check_dkim_signature: 0.71 (0.2%), check_dkim_adsp: 2.5 (0.7%), tests_pri_500: 5 (1.5%), rewrite_mail: 0.00 (0.0%) Subject: Re: [RFC][PATCH 00/14] VFS: Make all filesystems implement ->show_options() X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5070 Lines: 110 David Howells writes: > Here's a set of patches that: > > (1) Removes calls to save/replace_mount_options() where the filesystem > then implements ->show_options() anyway, ignoring ->s_options. > > (2) Makes all filesystems implement the ->show_options() superblock > operation rather than using generic_show_options(). If necessary, > extra information is stored in the superblock information. > > (3) Deletes save_mount_options(), replace_mount_options(), > generic_show_options() and super_block::s_options. > > This makes it easier to implement a context-based mount where the options > are passed individually over a file descriptor. It also allows duplicate > options, options that override each other and ignored options to be > resolved rather than storing irrelevant data. This makes me a little nervous but is probably fine. But we do need to be careful with remount. Today the rule is all options that need to be preserved need to be passed to remount. Passing options in one by one looks like it may make it easy to get that confused while you are developing your patches. > Further, a lot of the time, all the information we want to display is > stored in the super block information anyway, so the option string is > redundant. > > Some things I noted whilst doing this: > > (1) A number of filesystems take uid/gid options. Should these be > reported relative to the observer's user namespace rather than init's > user namespace? After all, you can't then use those uid/gid options > if the numbers are interpreted incorrectly if you try and forge a > mount command from them. Options should be relative to the mount call. Which is almost always &init_user_ns and in the general case would be sb->s_user_ns. Which I believe becomes the creator of the mount context in the model you are working towards. > (2) Should I provide a helper for displaying uid/gid options? > > (3) How much do we need to worry about racing with remount? Some > filesystems happily give out the contents of the super_block without > regard to the fact that remount might be changing it simultaneously - > ext4, for example. > > (4) What string options actually need 'munging'? > > These patches can be found here: > > https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=for-viro > > on top of three other minor patches. > > David > --- > David Howells (14): > VFS: Don't use save/replace_mount_options if not using generic_show_options > hugetlbfs: Implement show_options > omfs: Implement show_options > pstore: Implement show_options > ramfs: Implement show_options > bpf: Implement show_options > spufs: Implement show_options > befs: Implement show_options > affs: Implement show_options > afs: Implement show_options > isofs: Implement show_options > 9p: Implement show_options > orangefs: Implement show_options > VFS: Kill off s_options and helpers > > > Documentation/filesystems/vfs.txt | 6 -- > arch/powerpc/platforms/cell/spufs/inode.c | 21 +++++++-- > fs/9p/v9fs.c | 59 ++++++++++++++++++++++++ > fs/9p/v9fs.h | 3 + > fs/9p/vfs_super.c | 6 +- > fs/affs/super.c | 42 +++++++++++++++-- > fs/afs/super.c | 45 ++++++++++++++++++- > fs/befs/linuxvfs.c | 24 +++++++++- > fs/btrfs/super.c | 1 > fs/debugfs/inode.c | 2 - > fs/efivarfs/super.c | 1 > fs/hugetlbfs/inode.c | 70 +++++++++++++++++++++++------ > fs/isofs/inode.c | 51 ++++++++++++++++++++- > fs/isofs/isofs.h | 3 + > fs/namespace.c | 59 ------------------------ > fs/omfs/inode.c | 33 ++++++++++++-- > fs/orangefs/super.c | 15 ++++++ > fs/pstore/inode.c | 14 +++++- > fs/pstore/internal.h | 3 + > fs/pstore/platform.c | 2 - > fs/ramfs/inode.c | 32 +++++++++---- > fs/reiserfs/super.c | 4 -- > fs/super.c | 1 > fs/tracefs/inode.c | 2 - > include/linux/fs.h | 9 ---- > include/linux/hugetlb.h | 3 + > include/net/9p/client.h | 13 +++++ > include/net/9p/transport.h | 1 > kernel/bpf/inode.c | 16 +++++-- > net/9p/client.c | 25 ++++++++++ > net/9p/trans_fd.c | 31 ++++++++++++- > net/9p/trans_rdma.c | 31 ++++++++++++- > 32 files changed, 481 insertions(+), 147 deletions(-)