Re: FUSE passthrough: fd lifetime?

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

 



On Wed, Aug 28, 2024 at 12:48 PM Amir Goldstein <amir73il@xxxxxxxxx> wrote:

> > Similarly, it looks like the first backing ID is usually 1. Is it
> > guaranteed that 0 is never a valid backing ID? I am not sure, and it
> > would certainly help implementation on my side.
>
> No guarantee.
> There was some suggestion about special use for value 0,
> but I don't remember what it was right now.

In a file system, not all inodes are backed by a file. If 0 would not
be handed out as an ID, then backing ID=0 could mean: this node is not
backed by a file (and doesn't need to unregister the ID on
forget/release). If 0 is a valid ID, I either have to add another
boolean to the inode, or keep calling the ioctl until I get a non-zero
value.

Reading, the code, the call is

        id = idr_alloc_cyclic(&fc->backing_files_map, fb, 1, 0, GFP_ATOMIC);

ie. start=1. In other words, if the counter wraps, it will start at 1
again, and 0 is not handed out.

-- 
Han-Wen Nienhuys - hanwenn@xxxxxxxxx - http://www.xs4all.nl/~hanwen





[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