All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anna Schumaker <Anna.Schumaker@Netapp.com>
To: David Howells <dhowells@redhat.com>, <mszeredi@redhat.com>,
	<viro@zeniv.linux.org.uk>, <jlayton@redhat.com>
Cc: <linux-fsdevel@vger.kernel.org>, <linux-nfs@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCH 00/14] VFS: Introduce superblock configuration context [ver #2]
Date: Thu, 11 May 2017 13:26:57 -0400	[thread overview]
Message-ID: <68231d1a-9902-ce3d-73e3-6e74754832e4@Netapp.com> (raw)
In-Reply-To: <149451118535.4599.16084557087363834548.stgit@warthog.procyon.org.uk>

Hi David,

On 05/11/2017 09:59 AM, David Howells wrote:
> 
> Here are a set of patches to create a superblock configuration context
> prior to setting up a new mount, populating it with the parsed
> options/binary data, creating the superblock and then effecting the mount.
> 
> This allows namespaces and other information to be conveyed through the
> mount procedure.  It also allows extra error information to be returned
> (so many things can go wrong during a mount that a small integer isn't
> really sufficient to convey the issue).
> 
> This also allows Miklós Szeredi's idea of doing:
> 
> 	fd = fsopen("nfs");
> 	write(fd, "option=val", ...);
> 	fsmount(fd, "/mnt");
> 
> that he presented at LSF-2017 to be implemented (see the relevant patches
> in the series), to which I can add:
> 
> 	read(fd, error_buffer, ...);
> 
> to read back any error message.  I didn't use netlink as that would make it
> depend on CONFIG_NET and would introduce network namespacing issues.
> 
> I've implemented mount context handling for procfs and nfs.
> 
> Significant changes:
> 
>  ver #2:
> 
>  (*) Removed the ->fill_super() from sb_config_operations and passed it in
>      directly to functions that want to call it.  NFS now calls
>      nfs_fill_super() directly rather than jumping through a pointer to it
>      since there's only the one option at the moment.
> 
>  (*) Removed ->mnt_ns and ->sb from sb_config and moved ->pid_ns into
>      proc_sb_config.
> 
>  (*) Renamed create_super -> get_tree.
> 
>  (*) Renamed struct mount_context to struct sb_config and amended various
>      variable names.
> 
>  (*) sys_fsmount() acquired AT_* flags and MS_* flags (for MNT_* flags)
>      arguments.
> 
>  ver #1:
> 
>  (*) Split the sb_config stuff out into its own header.
> 
>  (*) Support non-context aware filesystems through a special set of
>      sb_config operations.
> 
>  (*) Stored the created superblock and root dentry into the sb_config after
>      creation rather than directly into a vfsmount.  This allows some
>      arguments to be removed to various NFS functions.
> 
>  (*) Added an explicit superblock-creation step.  This allows a created
>      superblock to then be mounted multiple times.
> 
>  (*) Added a flag to say that the sb_config is degraded and cannot have
>      another go at having a superblock creation whilst getting rid of the
>      one that says it's already mounted.
> 
> Further developments:
> 
>  (*) Implement sb reconfiguration (for now it returns ENOANO).
> 
>  (*) Implement mount context support in more filesystems, ext4 being next
>      on my list.
> 
>  (*) Move the walk-from-root stuff that nfs has to generic code so that you
>      can do something akin to:
> 
> 	mount /dev/sda1:/foo/bar /mnt
> 
>      See nfs_follow_remote_path() and mount_subtree().  This is slightly
>      tricky in NFS as we have to prevent referral loops.
> 
>  (*) Move the pid_ns pointer from struct mount_context to struct
>      proc_mount_context as I'm not sure it's necessary for anything other
>      than procfs.
> 
>  (*) Work out how to get at the error message incurred by submounts
>      encountered during nfs_follow_remote_path().
> 
>      Should the error message be moved to task_struct and made more
>      general, perhaps retrieved with a prctl() function?
> 
>  (*) Clean up/consolidate the security functions.  Possibly add a
>      validation hook to be called at the same time as the mount context
>      validate op.
> 
> The patches can be found here also:
> 
> 	http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=mount-context
> 
> David
> ---
> David Howells (14):
>       Provide a function to create a NUL-terminated string from unterminated data
>       Clean up whitespace in fs/namespace.c
>       VFS: Make get_mnt_ns() return the namespace
>       VFS: Make get_filesystem() return the affected filesystem
>       VFS: Provide empty name qstr
>       VFS: Introduce a superblock configuration context
>       Implement fsopen() to prepare for a mount
>       Implement fsmount() to effect a pre-configured mount
>       Sample program for driving fsopen/fsmount
>       procfs: Move proc_fill_super() to fs/proc/root.c
>       proc: Add superblock config support to procfs
>       NFS: Add mount context support.
>       Support legacy filesystems
>       Add commands to create or update a superblock
> 
> 
>  Documentation/filesystems/mounting.txt |  470 ++++++++
>  arch/x86/entry/syscalls/syscall_32.tbl |    2 
>  arch/x86/entry/syscalls/syscall_64.tbl |    2 
>  fs/Makefile                            |    3 
>  fs/dcache.c                            |    8 
>  fs/filesystems.c                       |    3 
>  fs/fsopen.c                            |  302 +++++
>  fs/gfs2/dir.c                          |    3 
>  fs/internal.h                          |    4 
>  fs/libfs.c                             |   17 
>  fs/mount.h                             |    3 
>  fs/namei.c                             |    3 
>  fs/namespace.c                         |  495 +++++++--
>  fs/nfs/Makefile                        |    2 
>  fs/nfs/client.c                        |   74 +
>  fs/nfs/getroot.c                       |   76 +
>  fs/nfs/internal.h                      |  142 +--
>  fs/nfs/mount.c                         | 1497 +++++++++++++++++++++++++++
>  fs/nfs/namespace.c                     |   76 +
>  fs/nfs/nfs3_fs.h                       |    2 
>  fs/nfs/nfs3client.c                    |    6 
>  fs/nfs/nfs3proc.c                      |    2 
>  fs/nfs/nfs4_fs.h                       |    4 
>  fs/nfs/nfs4client.c                    |   82 +
>  fs/nfs/nfs4namespace.c                 |  208 ++--
>  fs/nfs/nfs4proc.c                      |    3 
>  fs/nfs/nfs4super.c                     |  220 ++--
>  fs/nfs/proc.c                          |    2 
>  fs/nfs/super.c                         | 1782 ++------------------------------
>  fs/nsfs.c                              |    3 
>  fs/pipe.c                              |    3 
>  fs/proc/inode.c                        |   50 -
>  fs/proc/internal.h                     |    6 
>  fs/proc/root.c                         |  210 +++-
>  fs/sb_config.c                         |  524 +++++++++
>  fs/super.c                             |  110 +-
>  include/linux/dcache.h                 |    5 
>  include/linux/fs.h                     |   16 
>  include/linux/lsm_hooks.h              |   47 +
>  include/linux/mount.h                  |    4 
>  include/linux/nfs_xdr.h                |    7 
>  include/linux/sb_config.h              |  100 ++
>  include/linux/security.h               |   40 +
>  include/linux/string.h                 |    1 
>  include/linux/syscalls.h               |    3 
>  include/uapi/linux/magic.h             |    1 
>  kernel/sys_ni.c                        |    4 
>  mm/util.c                              |   24 
>  samples/fsmount/test-fsmount.c         |   79 +
>  security/security.c                    |   45 +
>  security/selinux/hooks.c               |  202 +++-
>  51 files changed, 4596 insertions(+), 2381 deletions(-)

Is there any way to split the NFS patch into multiple pieces?  The patch in your git tree is longer than my attention span, and I'm having a hard time keeping track of everything going on.  I also suspect that this might be why it doesn't show up in my email with the rest of your patches.

Thanks,
Anna


>  create mode 100644 Documentation/filesystems/mounting.txt
>  create mode 100644 fs/fsopen.c
>  create mode 100644 fs/nfs/mount.c
>  create mode 100644 fs/sb_config.c
>  create mode 100644 include/linux/sb_config.h
>  create mode 100644 samples/fsmount/test-fsmount.c
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  parent reply	other threads:[~2017-05-11 17:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11 13:59 [RFC][PATCH 00/14] VFS: Introduce superblock configuration context [ver #2] David Howells
2017-05-11 13:59 ` [PATCH 01/14] Provide a function to create a NUL-terminated string from unterminated data " David Howells
2017-05-11 14:00 ` [PATCH 02/14] Clean up whitespace in fs/namespace.c " David Howells
2017-05-11 14:00 ` [PATCH 03/14] VFS: Make get_mnt_ns() return the namespace " David Howells
2017-05-11 14:00 ` [PATCH 04/14] VFS: Make get_filesystem() return the affected filesystem " David Howells
2017-05-11 14:00 ` [PATCH 05/14] VFS: Provide empty name qstr " David Howells
2017-05-11 14:00 ` [PATCH 06/14] VFS: Introduce a superblock configuration context " David Howells
2017-05-11 14:00 ` [PATCH 07/14] Implement fsopen() to prepare for a mount " David Howells
2017-05-11 14:01 ` [PATCH 08/14] Implement fsmount() to effect a pre-configured " David Howells
2017-05-11 14:01 ` [PATCH 09/14] Sample program for driving fsopen/fsmount " David Howells
2017-05-11 14:01 ` [PATCH 10/14] procfs: Move proc_fill_super() to fs/proc/root.c " David Howells
2017-05-11 14:01 ` [PATCH 11/14] proc: Add superblock config support to procfs " David Howells
2017-05-11 14:01 ` [PATCH 12/14] NFS: Add mount context support. " David Howells
2017-05-11 14:01 ` [PATCH 13/14] Support legacy filesystems " David Howells
2017-05-11 14:01 ` [PATCH 14/14] Add commands to create or update a superblock " David Howells
2017-05-11 17:26 ` Anna Schumaker [this message]
2017-05-11 19:24 ` [RFC][PATCH 00/14] VFS: Introduce superblock configuration context " David Howells
2017-05-12 13:55   ` Anna Schumaker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=68231d1a-9902-ce3d-73e3-6e74754832e4@Netapp.com \
    --to=anna.schumaker@netapp.com \
    --cc=dhowells@redhat.com \
    --cc=jlayton@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=mszeredi@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.