kmountpoint: read a mount by its unique id with statmount()
On a cache miss, and after any change to the mount table, currentMountPointForUniqueId() re-read the whole table with currentMountPoints(), which statx()es every mount point and lists the gvfs FUSE directory. AT_STATX_DONT_SYNC does not stop the path walk from revalidating remote components, so a server that did not answer blocked the lookup, even for the id of a local disk.
statmount() reads one mount from the kernel mount tree without walking a path. It came with Linux 6.8, like STATX_MNT_ID_UNIQUE. A kernel that does not report supported_mask keeps the table re-read.
Measurements
A probe lists a folder on a network mount, then the server is made unreachable by dropping its packets, and the probe times each lookup. A lookup that has not returned after 15 s is reported as blocked.
| Server unreachable | master | this branch |
|---|---|---|
| SMB 3.1.1, isSlow() of a network item | blocked, over 15 s | 0.15 ms |
| SMB 3.1.1, isSlow() of 99 more items | 11.9 s | 0.48 ms |
| NFS 4.2 hard, isSlow() of a network item | blocked, over 15 s | 0.22 ms |
| NFS 4.2 hard, isSlow() of 99 more items | blocked, over 15 s | 0.24 ms |