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: Fri, 19 May 2017 15:05:52 +0100 [thread overview]
Message-ID: <23332.1495202752@warthog.procyon.org.uk> (raw)
In-Reply-To: <CAOssrKehzdSABr-K6Usb7AjxyJ-POtUbdRap0e8Jq78=o-cMLg@mail.gmail.com>
Miklos Szeredi <mszeredi@redhat.com> wrote:
> Yes. Current behavior seems to just ignore given options (except
> MS_RDONLY) in that case, so we need to keep that possibility.
Yeah. I wonder if we really should be consistency checking some parameters in
some filesystems - or, at least, offering the opportunity.
> Also I think it would be good to allow selecting when superblock is created:
>
> - non-exclusive create: if exists return it, if not create it
> - exclusive create: only create if non-existent
> - non-create: only return if exists
I quite like that idea. Use O_CREAT and O_EXCL? Probably better to define a
new flag space for fsopen() rather than trying to share with open(). I'm not
sure how likely it would be to be used, though.
> So what I propose is:
>
> 1) call ->parse_option()
>
> would get indication what we are trying to do (find and/or
> create and/or reconfig)
>
> this step is optional, the the filesystem type could possibly be
> enough for the following steps
>
> 2) call ->get_tree()
>
> pass sc containing parsed options and flags controlling the
> creation of the superblock (create/exclusive)
>
> this step is optional, not called if we are given an sb to work
> with (i.e. only reconfig)
No. We have to call this to get the root dentry. Whether or not it creates a
superblock - or even if it creates a superblock in someone else's filesystem
(the cpuset fs, for example) - is immaterial.
Further, we aren't given information as to whether the superblock was created
for us or not - though that can be changed.
Even further, I think by the time this returns, the superblock should be
live. It will be live if we're reusing it, though we can get s_umount to
prevent a race.
> 3) call ->reconfig()
>
> pass sc containing parsed options
>
> this step is optional, we might be instructed just to find or
> create the sb
Actually, it's arguable that we *shouldn't* be calling this if the superblock
already exists - otherwise we may end up changing the parameters someone else
has set.
For mount(2), for most filesystems, we have to leave the active parameters
unaltered for compatibility. For fsopen() I'm willing to add a consistency
check - but there probably has to be a flag to waive that as otherwise you
can't mount without determining what the other party's parameters were.
> I don't get it. We never passed MNT_* options as strings to the
> kernel.
You're right. I've moved all those flags over to the forbidden list.
> Ah, mnt_devname. The device name as just a special type of option and
> as such should be stored in the superblock.
I'll leave that for now and deal with it later. We have to be careful not to
break userspace by changing what's seen in /proc/mounts.
David
next prev parent reply other threads:[~2017-05-19 14:05 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
2017-05-18 8:09 ` Miklos Szeredi
2017-05-19 14:05 ` David Howells [this message]
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=23332.1495202752@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®