lkml.org 
[lkml]   [2019]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 02/25] vfs: Allow fsinfo() to query what's in an fs_context [ver #13]
Date
Christian Brauner <christian@brauner.io> wrote:

> > >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.

fsinfo(), as coded, is usable on any fd, as for fstat(), statx() and
fstatfs().

I have made it such that if you do this on the fd returned by fsopen() or
fspick(), the access is diverted to the filesystem that the fs_context refers
to since querying anon_inodes is of little value.

Now, it could be argued that it should require an AT_xxx flag to cause this
diversion to happen.

> 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?

At the moment it differs. In the former case, there may not even be a
superblock attached to the fd to query, though invariants like filesystem
parameter types and names can be queried.

David

\
 
 \ /
  Last update: 2019-06-21 16:51    [W:0.107 / U:0.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site