From: Jeff Layton <jlayton@redhat.com>
To: Miklos Szeredi <mszeredi@redhat.com>,
David Howells <dhowells@redhat.com>
Cc: viro <viro@zeniv.linux.org.uk>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
linux-nfs@vger.kernel.org, lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/9] VFS: Introduce a mount context
Date: Tue, 09 May 2017 14:51:24 -0400 [thread overview]
Message-ID: <1494355884.2659.18.camel@redhat.com> (raw)
In-Reply-To: <CAOssrKeR4bNwYyuwyr2d5fG8RcxeyWKREFTdnGqovus9t_2n4A@mail.gmail.com>
On Tue, 2017-05-09 at 14:02 +0200, Miklos Szeredi wrote:
> On Tue, May 9, 2017 at 11:41 AM, David Howells <dhowells@redhat.com> wrote:
> > Miklos Szeredi <mszeredi@redhat.com> wrote:
> >
> > > I think that's crazy. We don't return detailed errors for any other
> > > syscall for path lookup, so why would path lookup for mount be
> > > special.
> >
> > Firstly, we don't return detailed errors for mount() at the moment either.
> >
> > Secondly, path lookup might entail automounts, so perhaps we should do it for
> > path lookup too. Particularly in light of the fact that NFS4 mount uses
> > pathwalk to get from server:/ to server:/the/dir/I/actually/wanted/ so I'm
> > currently losing that error:-/
> >
> > Thirdly, the security operation I'm talking about is separate to path lookup -
> > though perhaps we should pass LOOKUP_MOUNT as an intent flag into pathwalk so
> > that the security check can be done there; perhaps combined with another one.
> >
> > Fourthly, why shouldn't we consider extending the facility to other system
> > calls in future? It would involve copying the string to task_struct and
> > providing a way to retrieve it, but that's not that hard to achieve.
>
> Maybe we should. In fact that sounds like a splendid idea. IMO even
> better, than having errors go via the fsfd descriptor. Pretty cheap
> on the kernel side, and completely optional on the userspace side.
>
A question here: What should happen if you go to set an error here, and
one is already set? Should it just free the string and replace it with
the new one? IOW, just keep the latest error? Or is it better to keep
the earlier one?
If you want to put this in the task_struct then I think you'll want to
sort that out. You could easily end up in this situation if a lot of
different kernel subsystems started using it to pass back detailed
errors.
> >
> > > And why would
> > >
> > > fd = open("/foo/bar", O_PATH);
> > > fsmount(fsfd, fd, NULL);
> > >
> > > behave differently from
> > >
> > > fsmount(fsfd, -1, "/foo/bar");
> > >
> > > ?
> >
> > There's argument that the former should return EFAULT. And that you should
> > set the path to "" and pass AT_EMPTY_PATH. I should probably make sure it
> > does that - and add a flags field. statx() was fixed to work this way.
> >
> > Question for you: Should the MNT_* flags be passed to fsmount(), perhaps in
> > MS_* form?
>
> MS_* flags are a mess. I don't think they should be used for any new
> functionality. MNT_* flags are much better, but there are some
> internal flags there as well.
>
> I think the struct file model is better, where we have the external
> O_* flags and the internal FMODE_* flags.
>
> Thanks,
> Miklos
> --
> 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
--
Jeff Layton <jlayton@redhat.com>
next prev parent reply other threads:[~2017-05-09 18:51 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-03 16:04 [RFC][PATCH 0/9] VFS: Introduce mount context David Howells
2017-05-03 16:04 ` [PATCH 1/9] Provide a function to create a NUL-terminated string from unterminated data David Howells
2017-05-03 16:55 ` Jeff Layton
2017-05-03 19:26 ` Rasmus Villemoes
2017-05-03 20:13 ` David Howells
2017-05-03 16:04 ` [PATCH 2/9] Clean up whitespace in fs/namespace.c David Howells
2017-05-03 16:04 ` [PATCH 3/9] VFS: Introduce a mount context David Howells
2017-05-03 18:13 ` Jeff Layton
2017-05-03 18:26 ` Joe Perches
2017-05-03 20:38 ` Matthew Wilcox
2017-05-03 21:36 ` Joe Perches
2017-05-04 6:28 ` Julia Lawall
2017-05-03 21:17 ` David Howells
2017-05-03 18:37 ` David Howells
2017-05-03 18:43 ` Joe Perches
2017-05-03 20:11 ` David Howells
2017-05-04 9:27 ` David Howells
2017-05-04 14:34 ` Joe Perches
2017-05-03 21:43 ` Rasmus Villemoes
2017-05-04 10:22 ` David Howells
2017-05-08 15:05 ` Miklos Szeredi
2017-05-08 22:57 ` David Howells
2017-05-09 8:03 ` Miklos Szeredi
2017-05-10 12:41 ` Karel Zak
2017-05-09 9:32 ` David Howells
2017-05-09 11:04 ` Miklos Szeredi
2017-05-09 9:41 ` David Howells
2017-05-09 12:02 ` Miklos Szeredi
2017-05-09 18:51 ` Jeff Layton [this message]
2017-05-10 7:24 ` Miklos Szeredi
2017-05-10 8:05 ` David Howells
2017-05-10 13:20 ` Jeff Layton
2017-05-10 13:30 ` Miklos Szeredi
2017-05-10 13:33 ` Miklos Szeredi
2017-05-10 13:48 ` Jeff Layton
2017-05-12 8:15 ` Miklos Szeredi
2017-05-10 13:31 ` David Howells
2017-05-10 13:37 ` Jeff Layton
2017-05-09 9:56 ` David Howells
2017-05-09 12:38 ` Miklos Szeredi
2017-05-03 16:05 ` [PATCH 4/9] Implement fsopen() to prepare for a mount David Howells
2017-05-03 18:37 ` Jeff Layton
2017-05-03 18:41 ` David Howells
2017-05-03 20:44 ` Rasmus Villemoes
2017-05-04 10:40 ` Karel Zak
2017-05-04 12:55 ` David Howells
2017-05-04 12:58 ` David Howells
2017-05-04 13:06 ` David Howells
2017-05-04 13:34 ` Karel Zak
2017-05-09 18:40 ` Jeff Layton
2017-05-08 15:10 ` Miklos Szeredi
2017-05-08 23:09 ` David Howells
2017-05-03 16:05 ` [PATCH 5/9] Implement fsmount() to effect a pre-configured mount David Howells
2017-05-03 16:05 ` [PATCH 6/9] Sample program for driving fsopen/fsmount David Howells
2017-05-03 16:05 ` [PATCH 7/9] procfs: Move proc_fill_super() to fs/proc/root.c David Howells
2017-05-03 16:05 ` [PATCH 8/9] proc: Support the mount context in procfs David Howells
2017-05-03 16:44 ` [RFC][PATCH 0/9] VFS: Introduce mount context Jeff Layton
2017-05-03 16:50 ` David Howells
2017-05-03 17:27 ` Jeff Layton
2017-05-05 14:35 ` Miklos Szeredi
2017-05-05 15:47 ` David Howells
2017-05-08 8:25 ` Miklos Szeredi
2017-05-08 8:35 ` David Howells
2017-05-08 8:43 ` Miklos Szeredi
2017-05-08 17:03 ` Djalal Harouni
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=1494355884.2659.18.camel@redhat.com \
--to=jlayton@redhat.com \
--cc=dhowells@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).