Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751850AbdGEPYG (ORCPT ); Wed, 5 Jul 2017 11:24:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47174 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750908AbdGEPYE (ORCPT ); Wed, 5 Jul 2017 11:24:04 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 014234E4D1 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dhowells@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 014234E4D1 Subject: [RFC][PATCH 00/14] VFS: Make all filesystems implement ->show_options() From: David Howells To: viro@zeniv.linux.org.uk Cc: dhowells@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 05 Jul 2017 16:24:01 +0100 Message-ID: <149926824154.20611.6104595541055328700.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 05 Jul 2017 15:24:04 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4316 Lines: 97 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. 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. (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(-)