From: Dave Chinner <david@fromorbit.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Zorro Lang <zlang@redhat.com>, Brian Foster <bfoster@redhat.com>,
fstests@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH v2] generic/623: fix test for runing on overlayfs
Date: Thu, 2 Jun 2022 09:44:43 +1000 [thread overview]
Message-ID: <20220601234443.GI227878@dread.disaster.area> (raw)
In-Reply-To: <20220601123406.265475-1-amir73il@gmail.com>
On Wed, Jun 01, 2022 at 03:34:06PM +0300, Amir Goldstein wrote:
> For this test to run on overlayfs we open a different file to perform
> shutdown while keeping the writeback target file open.
>
> xfs_io -c fsync perform fsync also on the writeback target file, which
> is needed for triggering the write fault.
>
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> ---
>
> Zorro,
>
> Following your comment on v1, this version does not change the
> behavior of the test when running on non-overlayfs.
>
> I tested that this test passes for both xfs and overlayfs+xfs on v5.18
> and tested that both configs fail with the same warning on v5.10.109.
>
> Thanks,
> Amir.
>
> tests/generic/623 | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/tests/generic/623 b/tests/generic/623
> index ea016d91..5971717c 100755
> --- a/tests/generic/623
> +++ b/tests/generic/623
> @@ -24,10 +24,22 @@ _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.
> +
> +# For this test to run on overlayfs we open a different file to perform
> +# shutdown while keeping the writeback target file open.
> +# xfs_io -c fsync post-shutdown performs fsync also on the writeback target file,
> +# which is critical for trigerring the writeback failure.
> +shutdown_cmd=()
> +shutdown_handle="$(_scratch_shutdown_handle)"
> +if [ "$shutdown_handle" != "$SCRATCH_MNT" ];then
> + shutdown_cmd+=("-c" "open $shutdown_handle")
> +fi
> +shutdown_cmd+=("-c" "shutdown")
IMO, this is unnecessary complexity. The original patch with the
"fsync acts on all open files" comment above explains the xfs_io
fsync quirk that enables the test to do what it is supposed to be
doing without any of the this conditional command construction.
The less special case handling we need to splice into the test code,
the better.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2022-06-01 23:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-01 12:34 [PATCH v2] generic/623: fix test for runing on overlayfs Amir Goldstein
2022-06-01 23:44 ` Dave Chinner [this message]
2022-06-02 4:19 ` Zorro Lang
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=20220601234443.GI227878@dread.disaster.area \
--to=david@fromorbit.com \
--cc=amir73il@gmail.com \
--cc=bfoster@redhat.com \
--cc=fstests@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=zlang@redhat.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