Re: [PATCH v3 03/10] virtiofsd: Use lo_inode_open() instead of openat()

2021-08-06 Thread Vivek Goyal
On Fri, Jul 30, 2021 at 05:01:27PM +0200, Max Reitz wrote: > The xattr functions want a non-O_PATH FD, so they reopen the lo_inode.fd > with the flags they need through /proc/self/fd. > > Similarly, lo_opendir() needs an O_RDONLY FD. Instead of the > /proc/self/fd trick, it just uses openat(fd, "

[PATCH v3 03/10] virtiofsd: Use lo_inode_open() instead of openat()

2021-07-30 Thread Max Reitz
The xattr functions want a non-O_PATH FD, so they reopen the lo_inode.fd with the flags they need through /proc/self/fd. Similarly, lo_opendir() needs an O_RDONLY FD. Instead of the /proc/self/fd trick, it just uses openat(fd, "."), because the FD is guaranteed to be a directory, so this works.