summaryrefslogtreecommitdiffstats
path: root/libmount/src/utils.c
diff options
context:
space:
mode:
authorKarel Zak2017-11-16 12:16:09 +0100
committerKarel Zak2017-11-16 12:16:09 +0100
commit42ee788268880e5dd3402f2179242cdb361ffe20 (patch)
tree6acdd00eb098d6a97574bee427bdb83540b1a329 /libmount/src/utils.c
parentlibblkid: Add support for Micron mpool formatted drives (diff)
downloadkernel-qcow2-util-linux-42ee788268880e5dd3402f2179242cdb361ffe20.tar.gz
kernel-qcow2-util-linux-42ee788268880e5dd3402f2179242cdb361ffe20.tar.xz
kernel-qcow2-util-linux-42ee788268880e5dd3402f2179242cdb361ffe20.zip
libmount: minimize utimensat() write test usage
utimensat() is pretty expensive when mounting parallel filesystems from the same source. It's possible to ignore all this if mtab is not writable. Note that this change is irrelevant for default util-linux builds where all around mtab is already disabled since v2.30 (commit 89958178f6d6ebe0944d423feaea66be521fff43). This change is relevant only for users who still use --enable-libmount-support-mtab. Reported-by: Douglas Jacobsen <dmjacobsen@lbl.gov> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/utils.c')
-rw-r--r--libmount/src/utils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libmount/src/utils.c b/libmount/src/utils.c
index 5db5494d3..56cdc206d 100644
--- a/libmount/src/utils.c
+++ b/libmount/src/utils.c
@@ -216,6 +216,8 @@ int mnt_is_readonly(const char *path)
{
struct timespec times[2];
+ DBG(UTILS, ul_debug(" doing utimensat() based write test"));
+
times[0].tv_nsec = UTIME_NOW; /* atime */
times[1].tv_nsec = UTIME_OMIT; /* mtime */