Thread (38 messages) 38 messages, 8 authors, 2024-06-04

Re: [PATCH RFC v2] fhandle: expose u64 mount id to name_to_handle_at(2)

From: Trond Myklebust <hidden>
Date: 2024-05-27 15:47:36
Also in: linux-fsdevel, linux-nfs, lkml

On Mon, 2024-05-27 at 15:17 +0200, Christian Brauner wrote:
Returning the 64bit mount id makes this race-free because we now have
statmount():

u64 mnt_id = 0;
name_to_handle_at(AT_FDCWD, "/path/to/file", &handle, &mnt_id, 0);
statmount(mnt_id);

Which gets you the device number which one can use to figure out the
uuid without ever having to open a single file (We could even expose
the
UUID of the filesystem through statmount() if we wanted to.).
It is not race free. statmount() depends on the filesystem still being
mounted somewhere in your namespace, which is not guaranteed above.

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help