From: Darrick J. Wong Date: Tue, 12 Feb 2019 02:17:32 +0000 (-0800) Subject: common: fix _require_btime for lazy filesystems X-Git-Tag: v2022.05.01~1259 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=08174ee11083c380e72a64686c98d38b276ea826;p=xfstests-dev.git common: fix _require_btime for lazy filesystems Filesystems are not required to try to fill the statx btime field unless the caller actually sets STATX_BTIME. They're allowed to volunteer that information "if it's cheap", but XFS doesn't volunteer and there may be filesystems that support btime but not cheaply. Either way, we want to test btime on any filesystem that supports it, cheaply or otherwise, so set STATX_BTIME when we're trying to detect support for it. [Eryu: fix _require_scratch_btime too] Signed-off-by: Darrick J. Wong Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/common/rc b/common/rc index ab468adf..c88c304c 100644 --- a/common/rc +++ b/common/rc @@ -3849,7 +3849,11 @@ _dmsetup_create() _require_btime() { - $XFS_IO_PROG -f $TEST_DIR/test_creation_time -c "statx -v" \ + # Note: filesystems are not required to report btime (creation time) + # if the caller doesn't ask for it, so we define STATX_BTIME here and + # pass it in to the statx command. + export STATX_BTIME=0x800 + $XFS_IO_PROG -f $TEST_DIR/test_creation_time -c "statx -m $STATX_BTIME -v" \ | grep btime >>$seqres.full 2>&1 || \ _notrun "inode creation time not supported by this filesystem" rm -f $TEST_DIR/test_creation_time @@ -3861,7 +3865,11 @@ _require_scratch_btime() _scratch_mkfs > /dev/null 2>&1 _scratch_mount - $XFS_IO_PROG -f $SCRATCH_MNT/test_creation_time -c "statx -v" \ + # Note: filesystems are not required to report btime (creation time) + # if the caller doesn't ask for it, so we define STATX_BTIME here and + # pass it in to the statx command. + export STATX_BTIME=0x800 + $XFS_IO_PROG -f $SCRATCH_MNT/test_creation_time -c "statx -m $STATX_BTIME -v" \ | grep btime >>$seqres.full 2>&1 || \ _notrun "inode creation time not supported by this filesystem"