Re: [fuse-devel] [fuse] Relevance of st_ino values

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

 



On Mon, Feb 11, 2019 at 9:44 PM Nikolaus Rath <Nikolaus@xxxxxxxx> wrote:
>
> On Feb 11 2019, Miklos Szeredi <miklos@xxxxxxxxxx> wrote:
> > On Mon, Feb 11, 2019 at 12:18 PM Jean-Pierre André
> > <jean-pierre.andre@xxxxxxxxxx> wrote:
> >>
> >> Nikolaus Rath wrote:
> >> > Hello,
> >> >
> >> > For several requests, FUSE userspace returns a struct stat to the
> >> > kernel. struct stat includes an st_ino field, but FUSE generally has a
> >> > separate field for the inode (e.g. fuse_entry_param.ino vs
> >> > fuse_entry_param.attr.st_ino).
> >> >
> >> > Does the kernel use the st_ino value at all, or is just passed through
> >> > to userspace?
> >
> > st_ino value is not used in any way by the kernel, just passed through
> > to userspace.
>
> Thanks! And there is nothing that userspace can do with those numbers
> other than comparing them to determine if two files are hardlinks of
> each other, right? They cannot be passed back to the kernel in a
> syscall?

True and true.   If you want something to pass back to the kernel, see
the name_to_handle_at(2) and open_by_handle_at(2) syscalls.

POSIX states that

  "The st_ino and st_dev fields taken together uniquely identify the
file within the system."

FUSE takes care of providing a unique st_dev, so the filesystem only
has to care about providing a unique st_ino.  Note: it's perfectly
fine to reuse st_ino value of an already deleted file, so {st_dev,
st_ino} only has to guarantee uniqueness at every single point in
time, but not across different points in time.

Thanks,
Miklos




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

  Powered by Linux