On Wed, Dec 13, 2023 at 08:37:57AM +0100, Donald Buczek wrote: > Probably not for the specific applications I mentioned (backup, mirror, > accounting). These are intended to run continuously, slowly and unnoticed > in the background, so they are memory and i/o throttled via cgroups anyway > and one is even using sleep after so-and-so many stat calls to reduce > its impact. > > If they could tell a directory from a snapshot, I would probably stop them > from walking into snapshots. And if not, the snapshot id is all that is > needed to tell a clone in a snapshot from a hardlink. So these don't really > need the filehandle. Perhaps we should allocate a bit for differentiating a snapshot from a non snapshot subvolume? > In the thread it was assumed, that there are other (unspecified) > applications which need the filehandle and currently use name_to_handle_at(). > > I though it was self-evident that a single syscall to retrieve all > information atomically is better than a set of syscalls. Each additional > syscall has overhead and you need to be concerned with the data changing > between the calls. All other things being equal, yeah it would be. But things are never equal :) Expanding struct statx is not going to be as easy as hoped, so we need to be a bit careful how we use the remaining space, and since as Dave pointed out the filehandle isn't needed for checking uniqueness unless nlink > 1 it's not really a hotpath in any application I can think of. (If anyone does know of an application where it might matter, now's the time to bring it up!) > Userspace nfs server as an example of an application, where visible > performance is more relevant, was already mentioned by someone else. I'd love to hear confirmation from someone more intimately familiar with NFS, but AFAIK it shouldn't matter there; the filehandle exists to support resuming IO or other operations to a file (because the server can go away and come back). If all the client did was a stat, there's no need for a filehandle - that's not needed until a file is opened.