Re: passthrough question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday, April 12th, 2024 at 5:08 AM, Amir Goldstein <amir73il@xxxxxxxxx> wrote:
> 
> 
> Sounds good, except returning ENOENT to user for open with zero backing id
> is confusing, so I think it has to be EIO like all the other illegal
> passthrough open replies.
> 
> Thanks,
> Amir.

Been at the Texas Linux Fest past couple days so I've not really had time to look at what you've done for lookup yet. Will do so soon.

RE fh: I think adding a "fh" to more of the protocol could be useful. I find it extremely convenient with file lifecycle management and if it could exist for node lifecycle too that could simplify server code. This just came to mind while trying to rework my server to use passthrough and haven't dug into the code to see how plausible it is.

RE FOPEN_PASSTHROUGH and complications I've found: I've found another practical issue. Granted this is a "me" problem in how mergerfs was designed but none the less a, I think, serious issue for me. mergerfs is multiuser. It runs at root, multithreaded, and will seteuid to ensure the syscalls it makes are in the user context of the client app (where appropriate.) Unless there is some API I'm unfamiliar with there is no way in Linux to open an existing fd. Instead you are expected to open /proc/self/fd/%d. But in my case since the process is running as root /proc/self/fd/ is owned by root:root and mode 0500. While a chown will return success on /proc/self/fd/ it has no effect and a chmod fails with EPERM. So non-root can't open the file. The only thing I can think of to do is to store all the details about the file and on future opens open the filepath and ensure it is the same file before returning back to the kernel otherwise return an error.





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux