Re: [PATCH 02/25] vfs: Allow fsinfo() to query what's in an fs_context [ver #13]

From
Christian Brauner <christian@brauner.io>
Date
2019-06-21 13:28:46
Also in
linux-fsdevel, lkml
Reply to
Christian Brauner, 2019-06-21
On Fri, Jun 21, 2019 at 03:16:04PM +0200, Christian Brauner wrote:
On June 21, 2019 3:12:43 PM GMT+02:00, David Howells [off-list ref] wrote:
quoted
Christian Brauner [off-list ref] wrote:
quoted
quoted
 static int vfs_fsinfo_fd(unsigned int fd, struct fsinfo_kparams
*params)
quoted
quoted
 {
 	struct fd f = fdget_raw(fd);
You're using fdget_raw() which means you want to allow O_PATH fds but
below you're checking whether the f_ops correspond to
fscontext_fops. If it's an O_PATH
It can't be.  The only way to get an fs_context fd is from fsopen() or
fspick() - neither of which allow O_PATH to be specified.

If you tried to go through /proc/pid/fd with open(O_PATH), I think
you'd get
the symlink, not the target.
Then you should use fdget(), no? :)
That is unless you want fsinfo() to be useable on any fd and just fds
that are returned from the new mount-api syscalls. Maybe that wasn't
clear from my first mail.

Is the information returned for:

int fd = fsopen()/fspick();
fsinfo(fd);

int ofd = open("/", O_PATH);
fsinfo(ofd, ...);

the same if they refer to the same mount or would they differ?

Christian
Thread (42 messages) 42 messages, 5 authors, last reply 2019-06-21
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help