Re: [PATCH v3 3/3] fs: fuse: add more information to fdinfo
From: Miklos Szeredi
Date: Fri May 09 2025 - 12:11:32 EST
On Fri, 9 May 2025 at 08:34, Chen Linxuan via B4 Relay
<devnull+chenlinxuan.uniontech.com@xxxxxxxxxx> wrote:
> static const struct file_operations fuse_file_operations = {
> .llseek = fuse_file_llseek,
> .read_iter = fuse_file_read_iter,
> @@ -3411,6 +3428,9 @@ static const struct file_operations fuse_file_operations = {
> .poll = fuse_file_poll,
> .fallocate = fuse_file_fallocate,
> .copy_file_range = fuse_copy_file_range,
> +#ifdef CONFIG_PROC_FS
> + .show_fdinfo = fuse_file_show_fdinfo,
> +#endif
> };
The backing file mechanism is an internal implementation detail of
fuse and does not need to be displayed in the fuse file's fdinfo.
Currently we can only have one backing file per fuse file, but that
may well change in the future, as well as other details like offset
into the backing file (think FS_IOC_FIEMAP).
So NAK unless there's a very good use case for this.
Adding fdinfo for the /dev/fuse file is encouraged, it would be good
to be able to retrieve the connection number from the dev fd.
Thanks,
Miklos