diff options
author | Chunwei Chen <[email protected]> | 2016-04-01 13:12:06 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-04-05 18:55:59 -0700 |
commit | 676007719462edf6ae1f0779252b99a0cb86b630 (patch) | |
tree | 0bcbc7b414b0668f8bc9fdd0becea8c50a51ceee /lib | |
parent | 704cd0758a1a4ecef47b0dfa097acd94c8e4f57d (diff) |
Make zfs mount according to relatime config in dataset
Also enable lazytime in mount.zfs
Signed-off-by: Chunwei Chen <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Issue #4482
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libzfs/libzfs_mount.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libzfs/libzfs_mount.c b/lib/libzfs/libzfs_mount.c index b6c47a25d..29907dc8b 100644 --- a/lib/libzfs/libzfs_mount.c +++ b/lib/libzfs/libzfs_mount.c @@ -365,6 +365,14 @@ zfs_add_options(zfs_handle_t *zhp, char *options, int len) error = zfs_add_option(zhp, options, len, ZFS_PROP_ATIME, MNTOPT_ATIME, MNTOPT_NOATIME); + /* + * don't add relatime/strictatime when atime=off, otherwise strictatime + * will force atime=on + */ + if (strstr(options, MNTOPT_NOATIME) == NULL) { + error = zfs_add_option(zhp, options, len, + ZFS_PROP_RELATIME, MNTOPT_RELATIME, MNTOPT_STRICTATIME); + } error = error ? error : zfs_add_option(zhp, options, len, ZFS_PROP_DEVICES, MNTOPT_DEVICES, MNTOPT_NODEVICES); error = error ? error : zfs_add_option(zhp, options, len, |