From: David Howells <dhowells@redhat.com>
To: Miklos Szeredi <mszeredi@redhat.com>
Cc: dhowells@redhat.com, viro <viro@zeniv.linux.org.uk>,
Jeff Layton <jlayton@redhat.com>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
linux-nfs@vger.kernel.org, lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 06/21] VFS: Introduce a superblock configuration context [ver #3]
Date: Wed, 17 May 2017 12:31:35 +0100 [thread overview]
Message-ID: <19461.1495020695@warthog.procyon.org.uk> (raw)
In-Reply-To: <CAOssrKcL7A=mLTeOe73jGbs7oK-5eneCNuCHNDY7OLy0_=KPUA@mail.gmail.com>
Miklos Szeredi <mszeredi@redhat.com> wrote:
> > (b) is internal-only at the moment, used by NFS submounts as triggered by
> > automounts. There isn't currently any way to supply mount options to this.
>
> And all blockdev based fs.
I see what you're getting at. In which case there are more cases:
(a) new mount, new sb struct with no source (eg. procfs, sysfs, tmpfs)
(b) new mount, new sb struct, params loaded from filesystem data (eg. bdev)
(c) new mount, new sb struct, params derived from parent (eg. NFS automount)
(d) new mount, shared extant sb struct
(e) remount
In the case of (d) where we're attempting to make another mount for an extant
super_block struct and we need to check the consistency of the parameters.
> > Ah - but some of these options have to be set *inside* sget() or before the
> > superblock becomes live, even the ones that can be changed in-flight.
>
> That would be the "???" category. Any concrete examples?
NFS is a good example. You need parameters that indicate the server to talk
to and specify I/O parameters before you even get the superblock as you have
to talk to the server first. I think this is particularly true of NFSv2/3
where you need to talk to mountd.
This would also be true of AFS. There you have to access the network to look
up the volume ID before you can call sget() as the volume ID is part of the
index key to the set of super_block structs.
Further, some of these values (I/O parameters in NFS's case, for example) form
part of the super_block struct index key, so you have to set those inside
sget()'s set callback.
> >> Also I think silently ignoring options is not always the right answer.
> >
> > Example?
>
> mount /dev/sda -oacl /mnt
> mount /dev/sda -onoacl /mnt2
So you'd like to give an error or a warning if ACLs are not supported, either
by the filesystem or the kernel as a whole?
> No really good match for what this method is doing. We could call it
> ->get_tree_to_mount(), but calling it just ->mount() implies that it's
> doing the mounting, which it is not.
Yes, but my point is that it's part of the mount procedure. We are, I assume,
intending to try and mount the thing at some point. I can leave it as
->get_tree() for the moment.
> You are thinking on the wrong level. Of course mount(2) needs to
> handle MS_NOSUID et al. But it's doing it now, and it isn't parsing
> "nosuid", just translating MS_NOSUID to MNT_NOSUID.
Ummm... That's done by the parser in this case, so effectively it is.
> For the fsopen() case you won't need to parse "nosuid" because that's a flag
> for fsmount().
Whilst this is true, that means that the parser has to operate differently in
the mount(2) and fsopen(2) cases - which I was trying to avoid. I guess I can
set a flag in the sb_config struct to indicate the source and then split out
these options into an only-for-mount(2) list.
> The only thing fsmount() should take from the sc is the root_dentry.
> It should be equivalent to what currently is a bind mount, except it
> should be able to fully configure the new mount.
It needs to take the device name as well. I wonder if it would be possible to
store the device name on the superblock and then leave a path-in-mount in the
vfsmount struct to fabricate a <source>:/<path> later. Though this would
change the behaviour if someone did:
mknod /dev/foo b 8 1
mknod /dev/bar b 8 1
mount /dev/foo /mnt/foo
mount /dev/bar /mnt/bar
as /proc/mounts would now show /dev/foo for /mnt/bar.
Also, I guess the subtype should be wangled in the superblock-getting code
(vfs_get_tree() as of patch 21) rather than in do_new_mount_sc(). If I do
that, then it may be that do_new_mount_sc() only needs the root dentry pointer
and not the sb_config pointer (except for error string passing).
> I'm still hoping we can move subpath handling completely to fsmount()
> in which case it would just take a struct super_block. But that would
> have to start with lots of filesystem work (not just NFS but CEPH,
> CIFS, etc..).
That would be nice, though NFSv2/3 might be tricky.
David
next prev parent reply other threads:[~2017-05-17 11:31 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-15 15:17 [RFC][PATCH 00/21] VFS: Introduce " David Howells
2017-05-15 15:18 ` [PATCH 01/21] Provide a function to create a NUL-terminated string from unterminated data " David Howells
2017-05-15 15:18 ` [PATCH 02/21] Clean up whitespace in fs/namespace.c " David Howells
2017-05-15 15:18 ` [PATCH 03/21] VFS: Make get_mnt_ns() return the namespace " David Howells
2017-05-15 15:18 ` [PATCH 04/21] VFS: Make get_filesystem() return the affected filesystem " David Howells
2017-05-15 15:19 ` [PATCH 05/21] VFS: Provide empty name qstr " David Howells
2017-05-15 15:19 ` [PATCH 06/21] VFS: Introduce a superblock configuration context " David Howells
2017-05-16 15:10 ` Miklos Szeredi
2017-05-16 16:33 ` David Howells
2017-05-17 7:54 ` Miklos Szeredi
2017-05-17 11:31 ` David Howells [this message]
2017-05-18 8:09 ` Miklos Szeredi
2017-05-19 14:05 ` David Howells
2017-05-15 15:19 ` [PATCH 07/21] Implement fsopen() to prepare for a mount " David Howells
2017-05-15 15:19 ` [PATCH 08/21] Implement fsmount() to effect a pre-configured " David Howells
2017-05-15 15:19 ` [PATCH 09/21] Sample program for driving fsopen/fsmount " David Howells
2017-05-15 15:19 ` [PATCH 10/21] procfs: Move proc_fill_super() to fs/proc/root.c " David Howells
2017-05-15 15:19 ` [PATCH 11/21] proc: Add superblock config support to procfs " David Howells
2017-05-15 15:19 ` [PATCH 12/21] NFS: Move mount bits into their own file " David Howells
2017-05-15 15:20 ` [PATCH 13/21] NFS: Constify mount argument match tables " David Howells
2017-05-15 15:20 ` [PATCH 14/21] NFS: Rename struct nfs_parsed_mount_data to struct nfs_sb_config " David Howells
2017-05-15 15:20 ` [PATCH 15/21] NFS: Split nfs_parse_mount_options() " David Howells
2017-05-15 15:20 ` [PATCH 16/21] NFS: Deindent nfs_sb_config_parse_option() " David Howells
2017-05-15 15:20 ` [PATCH 17/21] NFS: Add a small buffer in nfs_sb_config to avoid string dup " David Howells
2017-05-15 15:20 ` [PATCH 18/21] NFS: Do some tidying of the parsing code " David Howells
2017-05-15 15:20 ` [PATCH 19/21] NFS: Add mount context support. " David Howells
2017-05-15 15:20 ` [PATCH 20/21] Support legacy filesystems " David Howells
2017-05-15 15:21 ` [PATCH 21/21] Add commands to create or update a superblock " David Howells
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=19461.1495020695@warthog.procyon.org.uk \
--to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®