From: "Darrick J. Wong" <djwong@kernel.org>
To: "Luís Henriques" <lhenriques@suse.de>
Cc: fstests@vger.kernel.org, Luis Chamberlain <mcgrof@suse.com>,
Anthony Iliopoulos <ailiop@suse.com>
Subject: Re: [PATCH] generic/528: take fs timestamps granularity into account in tolerance interval
Date: Mon, 8 Nov 2021 09:15:25 -0800 [thread overview]
Message-ID: <20211108171525.GI24282@magnolia> (raw)
In-Reply-To: <20211108144905.11515-1-lhenriques@suse.de>
On Mon, Nov 08, 2021 at 02:49:05PM +0000, Luís Henriques wrote:
> Filesystems timestamps granularity can cause spurious test failures:
>
> QA output created by 528
> btime has value of 1635818936
> btime is NOT in range 1635818937 .. 1635818942
>
> This test output makes it looks like $testfile was created *before* the
> 'date' command was executed. What really happen was that btime was
> truncated according to the granularity defined by filesystem (I've seen
> this with both ext4 and xfs, but I guess others are also affected).
>
> Since granularity can't be worse than a second, simply adjust the test
> tolerance interval by 1 second.
/me wonders if that's still going to trip over vfat/ntfs, but as far as
modern xfs/ext4/btrfs go, this should be sufficient.
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
--D
> Signed-off-by: Luís Henriques <lhenriques@suse.de>
> ---
> tests/generic/528 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/generic/528 b/tests/generic/528
> index 24d1ee0e5ec7..a63827b1139b 100755
> --- a/tests/generic/528
> +++ b/tests/generic/528
> @@ -41,7 +41,7 @@ btime=$(date +%s -d "$($XFS_IO_PROG -c "statx -v -m $STATX_BTIME" $testfile | \
> grep 'stat.btime =' | cut -d '=' -f 2)")
> test -n "$btime" || echo "error: did not see btime in output??"
>
> -_within_tolerance "btime" "$btime" "$now" 0 5 -v
> +_within_tolerance "btime" "$btime" "$now" 1 5 -v
>
> status=0
> exit
prev parent reply other threads:[~2021-11-08 17:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-08 14:49 [PATCH] generic/528: take fs timestamps granularity into account in tolerance interval Luís Henriques
2021-11-08 17:15 ` Darrick J. Wong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211108171525.GI24282@magnolia \
--to=djwong@kernel.org \
--cc=ailiop@suse.com \
--cc=fstests@vger.kernel.org \
--cc=lhenriques@suse.de \
--cc=mcgrof@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox