On Mon, Oct 7, 2024 at 8:09 PM Chuck Lever III <chuck.lever@xxxxxxxxxx> wrote: > > > > > On Oct 7, 2024, at 11:26 AM, Amir Goldstein <amir73il@xxxxxxxxx> wrote: > > > > On Wed, Sep 25, 2024 at 11:14 AM Christian Brauner <brauner@xxxxxxxxxx> wrote: > >> > >>> open_by_handle_at(2) does not have AT_ flags argument, but also, I find > >>> it more useful API that encoding a connectable file handle can mandate > >>> the resolving of a connected fd, without having to opt-in for a > >>> connected fd independently. > >> > >> This seems the best option to me too if this api is to be added. > > > > Thanks. > > > > Jeff, Chuck, > > > > Any thoughts on this? > > I don't have anything clever to add. > Sometimes that's a good thing ;) FYI, I wrote a draft for the would be man page update to go with the proposed flag: name_to_handle_at() The name_to_handle_at() system call returns a file handle and a mount ID corresponding to the file specified by the dirfd and pathname arguments. ... When flags contain the AT_HANDLE_FID (since Linux 6.5) flag, the caller indicates that the returned file_handle is needed to identify the filesystem object, and not for opening the file later, so it should be expected that a subsequent call to open_by_handle_at() with the returned file_handle may fail. + When flags contain the AT_HANDLE_CONNECTABLE (since Linux 6.x) flag, + the caller indicates that the returned file_handle is needed to open a file with known path later, + so it should be expected that a subsequent call to open_by_handle_at() + with the returned file_handle may fail if the file was moved, but otherwise, + the path of the opened file is expected to be visible from the /proc/pid/fd/* magic link. + This flag can not be used in combination with the flags AT_HANDLE_FID, and AT_EMPTY_PATH. ... ESTALE The specified handle is not valid for opening a file. This error will occur if, for example, the file has been deleted. This error can also occur if the handle was acquired using the AT_HANDLE_FID flag and the filesystem does not support open_by_handle_at(). + This error can also occur if the handle was acquired using the AT_HANDLE_CONNECTABLE + flag and the file was moved to a different parent. -- Apropos man page, Aleksa, Are you planning to post a man page patch for AT_HANDLE_MNT_ID_UNIQUE? I realize that there is no man page maintainer at the moment, but I myself would love to have this patch in my man-page updates queue, until a man-page maintainer shows up, because, well, my update to AT_HANDLE_CONNECTABLE depends on it and so will my changes to fanotify to support mount/unmount events if/when I will get to them. Thanks, Amir.