All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Brian Foster <bfoster@redhat.com>, fstests@vger.kernel.org
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH] generic: test mapped write after shutdown and failed writeback
Date: Wed, 10 Feb 2021 12:56:28 -0600	[thread overview]
Message-ID: <aeafb8f1-c383-686f-c349-99bf6fef39e8@sandeen.net> (raw)
In-Reply-To: <20210210170628.173200-1-bfoster@redhat.com>

On 2/10/21 11:06 AM, Brian Foster wrote:
> XFS has a regression where it failed to check shutdown status in the
> write fault path. This produced an iomap warning if the page
> happened to recently fail a writeback attempt because writeback
> failure can clear Uptodate status on the page. Add a test for this
> scenario to help ensure mapped write failures are handled as
> expected in the event of filesystem shutdown.
> 
> Signed-off-by: Brian Foster <bfoster@redhat.com>

This looks reasonable to me, I have run the same xfs_io tests when
looking at this behavior and they do provoke it.

This could maybe run on $TEST? But I don't really care much either
way.

I spot-checked this on ext4 and it passes.

Reviewed-by: Eric Sandeen <sandeen@redhat.com>


> ---
> 
> Note that this test currently fails on XFS. The fix is posted for review
> on linux-xfs:
> 
> https://lore.kernel.org/linux-xfs/20210210170112.172734-1-bfoster@redhat.com/
> 
> Brian
> 
>  tests/generic/999     | 45 +++++++++++++++++++++++++++++++++++++++++++
>  tests/generic/999.out |  4 ++++
>  tests/generic/group   |  1 +
>  3 files changed, 50 insertions(+)
>  create mode 100755 tests/generic/999
>  create mode 100644 tests/generic/999.out
> 
> diff --git a/tests/generic/999 b/tests/generic/999
> new file mode 100755
> index 00000000..5e5408e7
> --- /dev/null
> +++ b/tests/generic/999
> @@ -0,0 +1,45 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0-only
> +# Copyright 2021 Red Hat, Inc.
> +#
> +# FS QA Test No. 999
> +#
> +# Test a write fault scenario on a shutdown fs.
> +#
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1	# failure is the default!
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +_cleanup()
> +{
> +	rm -f $tmp.*
> +}
> +
> +. ./common/rc
> +. ./common/filter
> +
> +rm -f $seqres.full
> +
> +_supported_fs generic
> +_require_scratch_nocheck
> +_require_scratch_shutdown
> +
> +_scratch_mkfs &>> $seqres.full
> +_scratch_mount
> +
> +# XFS had a regression where it failed to check shutdown status in the fault
> +# path. This produced an iomap warning because writeback failure clears Uptodate
> +# status on the page.
> +file=$SCRATCH_MNT/file
> +$XFS_IO_PROG -fc "pwrite 0 4k" -c fsync $file | _filter_xfs_io
> +$XFS_IO_PROG -x -c "mmap 0 4k" -c "mwrite 0 4k" -c shutdown -c fsync \
> +	-c "mwrite 0 4k" $file | _filter_xfs_io
> +
> +# success, all done
> +status=0
> +exit
> diff --git a/tests/generic/999.out b/tests/generic/999.out
> new file mode 100644
> index 00000000..f55569ff
> --- /dev/null
> +++ b/tests/generic/999.out
> @@ -0,0 +1,4 @@
> +QA output created by 999
> +wrote 4096/4096 bytes at offset 0
> +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> +fsync: Input/output error
> diff --git a/tests/generic/group b/tests/generic/group
> index b10fdea4..edd54ce5 100644
> --- a/tests/generic/group
> +++ b/tests/generic/group
> @@ -625,3 +625,4 @@
>  620 auto mount quick
>  621 auto quick encrypt
>  622 auto shutdown metadata atime
> +999 auto quick shutdown
> 

  reply	other threads:[~2021-02-10 18:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-10 17:06 [PATCH] generic: test mapped write after shutdown and failed writeback Brian Foster
2021-02-10 18:56 ` Eric Sandeen [this message]
2021-02-10 19:12   ` Brian Foster
2021-03-02  3:32 ` 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=aeafb8f1-c383-686f-c349-99bf6fef39e8@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=bfoster@redhat.com \
    --cc=fstests@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.