[PATCH 1/4] libfuse: add strictatime/lazytime mount options

Darrick J. Wong
2025-09-16T00:47:00Z

fuse+iomap leaves the kernel completely in charge of handling
timestamps. Add the lazytime and strictatime mount options so that
fuse+iomap filesystems can take advantage of those options.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
lib/mount.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/lib/mount.c b/lib/mount.c
index 140489fa74bb55..01d473902d50d7 100644
--- a/lib/mount.c
+++ b/lib/mount.c
@@ -117,9 +117,16 @@ static const struct fuse_opt fuse_mount_opts[] = {
FUSE_OPT_KEY("dirsync", KEY_KERN_FLAG),
FUSE_OPT_KEY("noatime", KEY_KERN_FLAG),
FUSE_OPT_KEY("nodiratime", KEY_KERN_FLAG),
- FUSE_OPT_KEY("nostrictatime", KEY_KERN_FLAG),
FUSE_OPT_KEY("symfollow", KEY_KERN_FLAG),
FUSE_OPT_KEY("nosymfollow", KEY_KERN_FLAG),
+#ifdef MS_LAZYTIME
+ FUSE_OPT_KEY("lazytime", KEY_KERN_FLAG),
+ FUSE_OPT_KEY("nolazytime", KEY_KERN_FLAG),
+#endif
+#ifdef MS_STRICTATIME
+ FUSE_OPT_KEY("strictatime", KEY_KERN_FLAG),
+ FUSE_OPT_KEY("nostrictatime", KEY_KERN_FLAG),
+#endif
FUSE_OPT_END
};

@@ -190,11 +197,18 @@ static const struct mount_flags mount_flags[] = {
{"noatime", MS_NOATIME, 1},
{"nodiratime", MS_NODIRATIME, 1},
{"norelatime", MS_RELATIME, 0},
- {"nostrictatime", MS_STRICTATIME, 0},
{"symfollow", MS_NOSYMFOLLOW, 0},
{"nosymfollow", MS_NOSYMFOLLOW, 1},
#ifndef __NetBSD__
{"dirsync", MS_DIRSYNC, 1},
+#endif
+#ifdef MS_LAZYTIME
+ {"lazytime", MS_LAZYTIME, 1},
+ {"nolazytime", MS_LAZYTIME, 0},
+#endif
+#ifdef MS_STRICTATIME
+ {"strictatime", MS_STRICTATIME, 1},
+ {"nostrictatime", MS_STRICTATIME, 0},
#endif
{NULL, 0, 0}
};