linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Eryu Guan <guaneryu@gmail.com>,
	linux-xfs <linux-xfs@vger.kernel.org>,
	fstests <fstests@vger.kernel.org>,
	Deepa Dinamani <deepa.kernel@gmail.com>
Subject: Re: [PATCH 3/5] generic/402: skip test if xfs_io can't parse the date value
Date: Wed, 5 Feb 2020 08:55:06 +0200	[thread overview]
Message-ID: <CAOQ4uxi7eDjzjxOU=2_w=putAErKTCTNUqJA-JKef3X9LLZOvQ@mail.gmail.com> (raw)
In-Reply-To: <158086092087.1989378.18220785148122680849.stgit@magnolia>

On Wed, Feb 5, 2020 at 2:02 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
>
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> If xfs_io's utimes command cannot interpret the arguments that are given
> to it, it will print out "Bad value for [am]time".  Detect when this
> happens and drop the file out of the test entirely.
>
> This is particularly noticeable on 32-bit platforms and the largest
> timestamp seconds supported by the filesystem is INT_MAX.  In this case,
> the maximum value we can cram into tv_sec is INT_MAX, and there is no
> way to actually test setting a timestamp of INT_MAX + 1 to test the
> clamping.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  tests/generic/402 |   11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
>
> diff --git a/tests/generic/402 b/tests/generic/402
> index 2a34d127..32988866 100755
> --- a/tests/generic/402
> +++ b/tests/generic/402
> @@ -63,10 +63,19 @@ run_test_individual()
>         # check if the time needs update
>         if [ $update_time -eq 1 ]; then
>                 echo "Updating file: $file to timestamp $timestamp"  >> $seqres.full
> -               $XFS_IO_PROG -f -c "utimes $timestamp 0 $timestamp 0" $file
> +               $XFS_IO_PROG -f -c "utimes $timestamp 0 $timestamp 0" $file >> $tmp.utimes 2>&1

Maybe use > instead of >> to be safe.

Also I would feel more comfortable if we special case the 0 timestamp
against being skipped, to be safe that we don't have a silent regression
in xfs_io or something causing all files to be skipped.

Otherwise:

Reviewed-by: Amir Goldstein <amir73il@gmail.com>


> +               cat $tmp.utimes >> $seqres.full
> +               if grep -q "Bad value" "$tmp.utimes"; then
> +                       rm -f $file $tmp.utimes
> +                       return
> +               fi
> +               cat $tmp.utimes
> +               rm $tmp.utimes
>                 if [ $? -ne 0 ]; then
>                         echo "Failed to update times on $file" | tee -a $seqres.full
>                 fi
> +       else
> +               test -f $file || return
>         fi
>
>         tsclamp=$((timestamp<tsmin?tsmin:timestamp>tsmax?tsmax:timestamp))
>

  reply	other threads:[~2020-02-05  6:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05  0:01 [PATCH 0/5] fstests: random fixes Darrick J. Wong
2020-02-05  0:01 ` [PATCH 1/5] xfs/449: filter out "Discarding..." from output Darrick J. Wong
2020-02-06  4:44   ` Zorro Lang
2020-02-05  0:01 ` [PATCH 2/5] xfs/020: fix truncation test Darrick J. Wong
2020-02-06  4:44   ` Zorro Lang
2020-02-05  0:02 ` [PATCH 3/5] generic/402: skip test if xfs_io can't parse the date value Darrick J. Wong
2020-02-05  6:55   ` Amir Goldstein [this message]
2020-02-09 15:29   ` Eryu Guan
2020-02-11 15:20     ` Darrick J. Wong
2020-02-05  0:02 ` [PATCH 4/5] xfs/117: fix inode corruption loop Darrick J. Wong
2020-02-06  4:50   ` Zorro Lang
2020-02-05  0:02 ` [PATCH 5/5] fsx: support 64-bit operation counts Darrick J. Wong
2020-02-06  4:57   ` Zorro Lang
2020-02-06 17:51     ` Darrick J. Wong

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='CAOQ4uxi7eDjzjxOU=2_w=putAErKTCTNUqJA-JKef3X9LLZOvQ@mail.gmail.com' \
    --to=amir73il@gmail.com \
    --cc=darrick.wong@oracle.com \
    --cc=deepa.kernel@gmail.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --cc=linux-xfs@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).