diff options
author | Nikolaus Rath <Nikolaus@rath.org> | 2023-05-08 16:12:08 -0700 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2023-05-12 23:27:43 +0100 |
commit | dba6b3983af34f30de01cf532dff0b66f0ed6045 (patch) | |
tree | 6e6e34a74f0867b46ced81c5740c15cc2b70de6a | |
parent | bb1890afd7d1eb33e95f36d1d9936dbd574260b6 (diff) | |
download | fuse-dba6b3983af34f30de01cf532dff0b66f0ed6045.tar.gz |
Do not pass unsupported mount options to the kernel.
The filesystem daemon is responsible for implementing eg. st_atime updates, so passing
options like relatime to the kernel results in them being silently ignored. Instead, such
options need to be interpreted (and filtered out) by the filesystem daemon.
-rw-r--r-- | include/fuse_lowlevel.h | 6 | ||||
-rw-r--r-- | lib/mount.c | 13 |
2 files changed, 6 insertions, 13 deletions
diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h index 6500e29..9142b1c 100644 --- a/include/fuse_lowlevel.h +++ b/include/fuse_lowlevel.h @@ -313,6 +313,12 @@ struct fuse_lowlevel_ops { * expected to reset the setuid and setgid bits if the file * size or owner is being changed. * + * This method will not be called to update st_atime or st_ctime implicitly + * (eg. after a read() request), and only be called to implicitly update st_mtime + * if writeback caching is active. It is the filesystem's responsibility to update + * these timestamps when needed, and (if desired) to implement mount options like + * `noatime` or `relatime`. + * * If the setattr was invoked from the ftruncate() system call * under Linux kernel versions 2.6.15 or later, the fi->fh will * contain the value set by the open method or will be undefined diff --git a/lib/mount.c b/lib/mount.c index 9c233a3..d71e6fc 100644 --- a/lib/mount.c +++ b/lib/mount.c @@ -111,15 +111,8 @@ static const struct fuse_opt fuse_mount_opts[] = { FUSE_OPT_KEY("async", KEY_KERN_FLAG), FUSE_OPT_KEY("sync", KEY_KERN_FLAG), FUSE_OPT_KEY("dirsync", KEY_KERN_FLAG), - FUSE_OPT_KEY("atime", KEY_KERN_FLAG), FUSE_OPT_KEY("noatime", KEY_KERN_FLAG), - FUSE_OPT_KEY("diratime", KEY_KERN_FLAG), FUSE_OPT_KEY("nodiratime", KEY_KERN_FLAG), - FUSE_OPT_KEY("lazytime", KEY_KERN_FLAG), - FUSE_OPT_KEY("nolazytime", KEY_KERN_FLAG), - FUSE_OPT_KEY("relatime", KEY_KERN_FLAG), - FUSE_OPT_KEY("norelatime", KEY_KERN_FLAG), - FUSE_OPT_KEY("strictatime", KEY_KERN_FLAG), FUSE_OPT_KEY("nostrictatime", KEY_KERN_FLAG), FUSE_OPT_END }; @@ -158,15 +151,9 @@ static const struct mount_flags mount_flags[] = { {"noexec", MS_NOEXEC, 1}, {"async", MS_SYNCHRONOUS, 0}, {"sync", MS_SYNCHRONOUS, 1}, - {"atime", MS_NOATIME, 0}, {"noatime", MS_NOATIME, 1}, - {"diratime", MS_NODIRATIME, 0}, {"nodiratime", MS_NODIRATIME, 1}, - {"lazytime", MS_LAZYTIME, 1}, - {"nolazytime", MS_LAZYTIME, 0}, - {"relatime", MS_RELATIME, 1}, {"norelatime", MS_RELATIME, 0}, - {"strictatime", MS_STRICTATIME, 1}, {"nostrictatime", MS_STRICTATIME, 0}, #ifndef __NetBSD__ {"dirsync", MS_DIRSYNC, 1}, |