]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libmount: use AT_STATX_DONT_SYNC when touch mountpoints
authorKarel Zak <kzak@redhat.com>
Mon, 17 Apr 2023 12:23:18 +0000 (14:23 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 17 Apr 2023 12:23:18 +0000 (14:23 +0200)
commit42e141d20505a0deb969c2e583a463c26aadc62f
tree3b51124b634557a620e3b72b8ee60a710a12d657
parent0d754deeddb60c016e199faa6ad4f1b26e934897
libmount: use AT_STATX_DONT_SYNC when touch mountpoints

* prefer statx() with AT_STATX_DONT_SYNC if available
* keep fstatat() and stat() as fallback
* add test to mnt_stat_mountpoint()

The goal is to minimize situations when we need classic stat() because
it triggers automount, and stat() syscall may hang on unreachable
network filesystems. The automount issue was resolved years ago by
AT_NO_AUTOMOUNT; now we can use statx() to fix also hangs on NFS.

Addresses: https://github.com/util-linux/util-linux/issues/2049
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/utils.c