generic/390: Add tests for inode timestamp policy
PATCH v3 1/1 generic/390: Add tests for inode timestamp policy
The test helps to validate clamping and mount behaviors according to supported file system timestamp ranges.
Note that the test can fail on 32-bit systems for a few file systems. This will be corrected when vfs is transitioned to use 64-bit timestamps.
---
The branch of the kernel tree can be located at
https://github.com/deepa-hub/vfs refs/heads/vfs_timestamp_policy
The xfs_io patch to add utimes is at
https://www.spinics.net/lists/linux-xfs/msg02952.html
Changes since v2:
* Refactored notrun handling
* Updated comments
Changes since v1:
* Use xfs_io utimes command
* Updated error handling
* Reorganized code according to review comments
common/rc | 48 +++++++++++++ tests/generic/390 | 192 ++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/390.out | 2 + tests/generic/group | 1 + 4 files changed, 243 insertions(+) create mode 100755 tests/generic/390 create mode 100644 tests/generic/390.out
common/rc +48 -0
@@ -1960,6 +1960,51 @@ _run_aiodio() return $status } +# this test requires y2038 sysfs switch and filesystem +# timestamp ranges support. +_require_y2038() +{ + local device=${1:-$TEST_DEV} + local sysfsdir=/proc/sys/fs/fs-timestamp-check-on + + if [ ! -e $sysfsdir ]; then + _notrun "no kernel support for y2038 sysfs switch" + fi + + local tsmin tsmax + read tsmin tsmax <<<$(_filesystem_timestamp_range $device) + if [ $tsmin -eq -1 -a $tsmax -eq -1 ]; then + _notrun "filesystem $FSTYP timestamp bounds are unknown" + fi +} + +_filesystem_timestamp_range() +{ + device=${1:-$TEST_DEV} + case $FSTYP in + ext4) + if [ $(dumpe2fs -h $device 2>/dev/null | grep "Inode size:" | cut -d: -f2) -gt 128 ]; then + echo "-2147483648 15032385535" + else + echo "-2147483648 2147483647" + fi + ;; + + xfs) + echo "-2147483648 2147483647" + ;; + jfs) + echo "0 4294967295" + ;; + f2fs) + echo "-2147483648 2147483647" + ;; + *) + echo "-1 -1" + ;; + esac +} + # indicate whether YP/NIS is active or not # _yp_active()
@@ -2070,6 +2115,9 @@ _require_xfs_io_command() echo $testio | egrep -q "Inappropriate ioctl" && \ _notrun "xfs_io $command support is missing" ;; + "utimes" ) + testio=`$XFS_IO_PROG -f -c "utimes" 0 0 0 0 $testfile 2>&1` + ;; *) testio=`$XFS_IO_PROG -c "$command help" 2>&1` esac
tests/generic/390 new file +192 -0
192 lines not on this page · raw message
tests/generic/390.out new file +2 -0
@@ -0,0 +1,2 @@ +QA output created by 390 +y2038 inode timestamp tests completed successfully
tests/generic/group +1 -0
@@ -392,3 +392,4 @@ 387 auto clone 388 auto log metadata 389 auto quick acl +390 auto quick rw
Signature · 1 line
2.7.4
Obsolete test? (Was: Re: [PATCH v3] generic/390: Add tests for inode timestamp policy)
Quoted 7 lines · Deepa Dinamani
The test helps to validate clamping and mount behaviors according to supported file system timestamp ranges.
Note that the test can fail on 32-bit systems for a few file systems. This will be corrected when vfs is transitioned to use 64-bit timestamps.
Quoted 5 lines
Signed-off-by Deepa Dinamani <[email protected]>---
The branch of the kernel tree can be located athttps://github.com/deepa-hub/vfs refs/heads/vfs_timestamp_policy
It's 2019 and the functionality hasn't been merged to kernel, but maybe there's a replacement I have missed.
common/rc _run_aiodio() · line 1972
Quoted 9 lines
common/rc +9
-0+# timestamp ranges support. +_require_y2038() +{ + local device=${1:-$TEST_DEV} + local sysfsdir=/proc/sys/fs/fs-timestamp-check-on + + if [ ! -e $sysfsdir ]; then + _notrun "no kernel support for y2038 sysfs switch" + fi
This will always fail, so either the kernel functionality gets merged or the test dropped. Can you let us know the status? Thanks.
Re: Obsolete test? (Was: Re: [PATCH v3] generic/390: Add tests for inode timestamp policy)
Quoted 19 lines · David Sterba
Quoted 9 lines · Deepa Dinamani
The test helps to validate clamping and mount behaviors according to supported file system timestamp ranges.
Note that the test can fail on 32-bit systems for a few file systems. This will be corrected when vfs is transitioned to use 64-bit timestamps.
Quoted 5 lines
Signed-off-by Deepa Dinamani <[email protected]>---
The branch of the kernel tree can be located athttps://github.com/deepa-hub/vfs refs/heads/vfs_timestamp_policy
It's 2019 and the functionality hasn't been merged to kernel, but maybe there's a replacement I have missed.
Quoted 12 lines
common/rc _run_aiodio() · line 1972
Quoted 9 lines
common/rc +9
-0+# timestamp ranges support. +_require_y2038() +{ + local device=${1:-$TEST_DEV} + local sysfsdir=/proc/sys/fs/fs-timestamp-check-on + + if [ ! -e $sysfsdir ]; then + _notrun "no kernel support for y2038 sysfs switch" + fiThis will always fail, so either the kernel functionality gets merged or the test dropped. Can you let us know the status? Thanks.
I’m posting a more comprehensive kernel series (~35 patches) for this in a week or so. This test was requested as a prerequisite to merge the series:
https://lists.linaro.org/pipermail/y2038/2016-November/001981.html
There have been 5 versions of patches posted since then. It has been a little difficult to get these reviewed.
The series makes more sense now anyway as we finally have 64 bit timestamps for vfs.
If the test is a precondition, then we should still keep it?
-Deepa
-Deepa
Re: Obsolete test? (Was: Re: [PATCH v3] generic/390: Add tests for inode timestamp policy)
Quoted 32 lines · Deepa Dinamani
Quoted 19 lines · David Sterba
Quoted 9 lines · Deepa Dinamani
The test helps to validate clamping and mount behaviors according to supported file system timestamp ranges.
Note that the test can fail on 32-bit systems for a few file systems. This will be corrected when vfs is transitioned to use 64-bit timestamps.
Quoted 5 lines
Signed-off-by Deepa Dinamani <[email protected]>---
The branch of the kernel tree can be located athttps://github.com/deepa-hub/vfs refs/heads/vfs_timestamp_policy
It's 2019 and the functionality hasn't been merged to kernel, but maybe there's a replacement I have missed.
Quoted 12 lines
common/rc _run_aiodio() · line 1972
Quoted 9 lines
common/rc +9
-0+# timestamp ranges support. +_require_y2038() +{ + local device=${1:-$TEST_DEV} + local sysfsdir=/proc/sys/fs/fs-timestamp-check-on + + if [ ! -e $sysfsdir ]; then + _notrun "no kernel support for y2038 sysfs switch" + fiThis will always fail, so either the kernel functionality gets merged or the test dropped. Can you let us know the status? Thanks.
Quoted 6 lines
I’m posting a more comprehensive kernel series (~35 patches) for this in a week or so. This test was requested as a prerequisite to merge the series:
https://lists.linaro.org/pipermail/y2038/2016-November/001981.html
There have been 5 versions of patches posted since then. It has been a little difficult to get these reviewed.
Ok, understood.
Quoted 3 lines
The series makes more sense now anyway as we finally have 64 bit timestamps for vfs.
If the test is a precondition, then we should still keep it?
Yeah, in that case keep it. The kernel patches are on the way to mainline and strftime("%Y") is still less then 2038. Thanks.