From: Karel Zak <kzak@redhat.com>
To: Miklos Szeredi <mszeredi@redhat.com>
Cc: David Howells <dhowells@redhat.com>,
viro <viro@zeniv.linux.org.uk>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
linux-nfs@vger.kernel.org, lkml <linux-kernel@vger.kernel.org>,
Jeff Layton <jlayton@redhat.com>
Subject: Re: [PATCH 06/14] VFS: Implement fsmount() to effect a pre-configured mount [ver #6]
Date: Wed, 11 Oct 2017 10:54:13 +0200 [thread overview]
Message-ID: <20171011085413.gexlklmojlve5imd@ws.net.home> (raw)
In-Reply-To: <CAOssrKeGsgEqW+XCf_UAkH5XamWqo5a549wFHyHSC1OUzVvJag@mail.gmail.com>
On Tue, Oct 10, 2017 at 03:38:21PM +0200, Miklos Szeredi wrote:
> On Tue, Oct 10, 2017 at 11:51 AM, Karel Zak <kzak@redhat.com> wrote:
> > On Tue, Oct 10, 2017 at 10:00:01AM +0200, Miklos Szeredi wrote:
> >> > +
> >> > + if (flags & MS_RDONLY)
> >> > + mnt_flags |= MNT_READONLY;
> >> > + if (flags & MS_NOSUID)
> >> > + mnt_flags |= MNT_NOSUID;
> >> > + if (flags & MS_NODEV)
> >> > + mnt_flags |= MNT_NODEV;
> >> > + if (flags & MS_NOEXEC)
> >> > + mnt_flags |= MNT_NOEXEC;
> >> > + if (flags & MS_NODIRATIME)
> >> > + mnt_flags |= MNT_NODIRATIME;
> >> > +
> >> > + if (flags & MS_STRICTATIME) {
> >> > + if (flags & MS_NOATIME)
> >> > + return -EINVAL;
> >> > + } else if (flags & MS_NOATIME) {
> >> > + mnt_flags |= MNT_NOATIME;
> >> > + } else {
> >> > + mnt_flags |= MNT_RELATIME;
> >> > + }
> >>
> >> I'm not sure reusing the MS_FLAGS is the right choice. Why not export
> >> MNT_* to userspace? That would get us a clean namespace without
> >> confusion with sb flags and no need to convert back and forth.
> >
> > Well, if you think about it as about two separated things -- VFS-flags
> > and FS-flags (and for example /proc/#/mountinfo already uses two
> > columns for the flags) than the question is why the API uses one
> > variable?
> >
> > Would be better to use two variables everywhere? (mostly for the
> > syscall).
> >
> > It would be nice to keep for example propagation flags only in
> > vfs_flags, or use MS_RDONLY according to context (for FS or for VFS)
> > without extra MS_BIND, etc.
>
> MS_BIND will be gone in the new API. The two separate columns in
> /proc/#/mountinfo are going to be two separate things on the new
> interface (one is writes to the fsfd provided by fsopen(2), the other
> in flags for fsmount(2)).
Ah, nice.
> The question is how to call the mount flags
> (what you call vfs flags), "MS_RDONLY" or "MNT_RDONLY" on the uAPI.
> Either is probably fine, but I feel that "MNT_FOO" is better, because
> it's a relatively clean namespace concerned with mount flags and not
> polluted with all the scum that mount(2) collected.
Hmm.. for example libmount already uses MNT_ namespace in header
files for all macros. So, I wont be happy with MNT_ in userspace ;-(
I like clone, epoll, etc flags ... there is no any abbreviation and
the prefix follows syscall or API name (CLONE_xxx, EPOLLxxx), what
about MOUNT_FOO ?
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
next prev parent reply other threads:[~2017-10-11 8:54 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-06 15:49 [PATCH 00/14] VFS: Introduce filesystem context [ver #6] David Howells
2017-10-06 15:49 ` [PATCH 01/14] VFS: Introduce the structs and doc for a " David Howells
2017-10-06 15:49 ` [PATCH 02/14] VFS: Add LSM hooks for " David Howells
2017-10-06 20:37 ` Randy Dunlap
2017-10-06 15:49 ` [PATCH 03/14] VFS: Implement a filesystem superblock creation/configuration " David Howells
2017-10-06 20:34 ` Randy Dunlap
2017-10-06 23:13 ` David Howells
2017-10-07 0:08 ` Randy Dunlap
2017-10-10 7:49 ` Miklos Szeredi
2017-10-10 15:24 ` David Howells
2017-10-26 16:24 ` David Howells
2017-10-27 9:24 ` Miklos Szeredi
2017-10-27 14:35 ` David Howells
2017-10-27 15:33 ` Miklos Szeredi
2017-10-27 16:03 ` David Howells
2017-10-30 8:44 ` Miklos Szeredi
2017-10-06 15:49 ` [PATCH 04/14] VFS: Remove unused code after filesystem context changes " David Howells
2017-10-06 15:49 ` [PATCH 05/14] VFS: Implement fsopen() to prepare for a mount " David Howells
2017-10-26 17:11 ` Jeff Layton
2017-10-26 19:01 ` Jeff Layton
2017-10-06 15:49 ` [PATCH 06/14] VFS: Implement fsmount() to effect a pre-configured " David Howells
2017-10-10 8:00 ` Miklos Szeredi
2017-10-10 9:51 ` Karel Zak
2017-10-10 13:38 ` Miklos Szeredi
2017-10-11 8:54 ` Karel Zak [this message]
2017-10-06 15:50 ` [PATCH 07/14] VFS: Add a sample program for fsopen/fsmount " David Howells
2017-10-26 17:21 ` Jeff Layton
2017-10-26 22:40 ` David Howells
2017-10-06 15:50 ` [PATCH 08/14] procfs: Move proc_fill_super() to fs/proc/root.c " David Howells
2017-10-06 15:50 ` [PATCH 09/14] proc: Add fs_context support to procfs " David Howells
2017-10-06 15:50 ` [PATCH 10/14] ipc: Convert mqueue fs to fs_context " David Howells
2017-10-06 15:50 ` [PATCH 11/14] cpuset: Use " David Howells
2017-10-06 15:50 ` [PATCH 12/14] kernfs, sysfs, cgroup, intel_rdt: Support " David Howells
2017-10-06 15:50 ` [PATCH 13/14] hugetlbfs: Convert to " David Howells
2017-10-06 15:50 ` [PATCH 14/14] VFS: Remove kern_mount_data() " 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=20171011085413.gexlklmojlve5imd@ws.net.home \
--to=kzak@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).