generic: test creation time recovery after power failure

After fsync, filesystem should guarantee inode metadata including
creation time being persisted, so even after sudden power-cut, during
mount, we should recover i_crtime_{,nsec} fields correctly, in order
to not loss those meta info.

So adding this testcase to check whether generic filesystem can
guarantee that.

Note that, it needs inode creation time support on specified filesystem.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
Chao Yu
2018-10-07 20:25:48 +08:00
committed by Eryu Guan
parent 1c29d399b6
commit 28c8fb706f
4 changed files with 107 additions and 0 deletions
+8
View File
@@ -3820,6 +3820,14 @@ _dmsetup_create()
$UDEV_SETTLE_PROG >/dev/null 2>&1
}
_require_btime()
{
$XFS_IO_PROG -f $TEST_DIR/test_creation_time -c "statx -v" \
| grep btime >>$seqres.full 2>&1 || \
_notrun "inode creation time not supported by this filesystem"
rm -f $TEST_DIR/test_creation_time
}
init_rc
################################################################################