Enable relatime by default

Linux sets relatime on mount by default for any file system,
but relatime=off in ZFS disables it explicitly.

Let's be consistent with other file systems on Linux.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Melikov <mail@gmelikov.ru>
Closes #13614
This commit is contained in:
George Melikov
2022-08-13 00:20:25 +03:00
committed by GitHub
parent b3d0568cfd
commit fbc210fab2
7 changed files with 14 additions and 12 deletions
@@ -62,11 +62,9 @@ do
mtpt=$(snapshot_mountpoint $dst)
log_mustnot check_atime_updated $mtpt/$TESTFILE
else
if is_linux; then
log_must zfs set relatime=off $dst
fi
log_must zfs set atime=on $dst
log_must zfs set relatime=off $dst
log_must check_atime_updated $mtpt/$TESTFILE
log_must check_atime_updated $mtpt/$TESTFILE
fi
@@ -62,6 +62,7 @@ do
else
log_must zfs set atime=on $dst
log_must zfs set relatime=on $dst
log_must check_atime_updated $mtpt/$TESTFILE
log_mustnot check_atime_updated $mtpt/$TESTFILE
fi
@@ -65,11 +65,10 @@ do
mtpt=$(snapshot_mountpoint $dst)
log_mustnot check_atime_updated $mtpt/$TESTFILE
else
if is_linux; then
log_must zfs set relatime=off $(dirname $dst)
fi
log_must zfs set atime=on $(dirname $dst)
# inherited relatime won't apply because of mount option, set explicitly
log_must zfs set relatime=off $dst
log_must check_atime_updated $mtpt/$TESTFILE
log_must check_atime_updated $mtpt/$TESTFILE
fi
@@ -68,6 +68,7 @@ do
else
log_must zfs set atime=on $(dirname $dst)
log_must zfs set relatime=on $(dirname $dst)
log_must check_atime_updated $mtpt/$TESTFILE
log_mustnot check_atime_updated $mtpt/$TESTFILE
fi
+5 -2
View File
@@ -33,7 +33,7 @@
# for 10 sec.
# 4. Verify that l2arc_write_max is set back to the default.
# 5. Set l2arc_write_max to a value less than the cache device size but
# larger than the default (64MB).
# larger than the default (256MB).
# 6. Record the l2_size.
# 7. Random read for 1 sec.
# 8. Record the l2_size again.
@@ -87,6 +87,9 @@ log_must truncate -s $VDEV_SZ $VDEV
log_must zpool create -f $TESTPOOL $VDEV cache $VCACHE
# Actually, this test relies on atime writes to force the L2 ARC discards
log_must zfs set relatime=off $TESTPOOL
log_must fio $FIO_SCRIPTS/mkfiles.fio
log_must fio $FIO_SCRIPTS/random_reads.fio
@@ -94,7 +97,7 @@ typeset write_max2=$(get_tunable L2ARC_WRITE_MAX)
log_must test $write_max2 -eq $write_max
log_must set_tunable32 L2ARC_WRITE_MAX $(( 64 * 1024 * 1024 ))
log_must set_tunable32 L2ARC_WRITE_MAX $(( 256 * 1024 * 1024 ))
export RUNTIME=1
typeset do_once=true