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