From: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
To: "Darrick J. Wong" <djwong@kernel.org>,
djwong@kernel.org, zlang@redhat.com
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me,
willy@infradead.org
Subject: Re: [PATCH 1/1] generic: test FALLOC_FL_UNSHARE when pagecache is not loaded
Date: Tue, 26 Sep 2023 10:51:19 +0530 [thread overview]
Message-ID: <87h6nh5x2o.fsf@doe.com> (raw)
In-Reply-To: <169567819441.2270025.10851897053852323695.stgit@frogsfrogsfrogs>
"Darrick J. Wong" <djwong@kernel.org> writes:
> From: Darrick J. Wong <djwong@kernel.org>
>
> Add a regression test for funsharing uncached files to ensure that we
> actually manage the pagecache state correctly.
>
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
> tests/xfs/1936 | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> tests/xfs/1936.out | 4 ++
> 2 files changed, 92 insertions(+)
> create mode 100755 tests/xfs/1936
> create mode 100644 tests/xfs/1936.out
>
>
> diff --git a/tests/xfs/1936 b/tests/xfs/1936
> new file mode 100755
> index 0000000000..e07b8f4796
> --- /dev/null
> +++ b/tests/xfs/1936
> @@ -0,0 +1,88 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2023 Oracle. All Rights Reserved.
> +#
> +# FS QA Test 1936
> +#
> +# This is a regression test for the kernel commit noted below. The stale
> +# memory exposure can be exploited by creating a file with shared blocks,
> +# evicting the page cache for that file, and then funshareing at least one
> +# memory page's worth of data. iomap will mark the page uptodate and dirty
> +# without ever reading the ondisk contents.
> +#
> +. ./common/preamble
> +_begin_fstest auto quick unshare clone
> +
> +_cleanup()
> +{
> + cd /
> + rm -r -f $tmp.* $testdir
> +}
> +
> +# real QA test starts here
> +
> +# Import common functions.
> +. ./common/filter
> +. ./common/attr
We might as well remove above imports if we are not using those in this test.
> +. ./common/reflink
> +
> +_fixed_by_git_commit kernel XXXXXXXXXXXXX \
> + "iomap: don't skip reading in !uptodate folios when unsharing a range"
Once I guess it is merged, we will have the commit-id. Ohh wait, we have
it already right?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=35d30c9cf12730a1e37053dfde4007c7cc452d1a
With that the testcode looks good to me. Thanks for finding an easy
reproducer. Please feel free to add -
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
-ritesh
next prev parent reply other threads:[~2023-09-26 5:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-25 21:43 [PATCHSET v2 0/1] fstests: fix unshare data corruption bug Darrick J. Wong
2023-09-25 21:43 ` [PATCH 1/1] generic: test FALLOC_FL_UNSHARE when pagecache is not loaded Darrick J. Wong
2023-09-26 5:21 ` Ritesh Harjani [this message]
2023-09-26 14:47 ` Darrick J. Wong
-- strict thread matches above, loose matches on Subject: below --
2023-10-09 18:18 [PATCHSET v3 0/1] fstests: fix unshare data corruption bug Darrick J. Wong
2023-10-09 18:19 ` [PATCH 1/1] generic: test FALLOC_FL_UNSHARE when pagecache is not loaded Darrick J. Wong
2023-10-10 7:05 ` Christoph Hellwig
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=87h6nh5x2o.fsf@doe.com \
--to=ritesh.list@gmail.com \
--cc=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=guan@eryu.me \
--cc=linux-xfs@vger.kernel.org \
--cc=willy@infradead.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