public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Ritesh Harjani <ritesh.list@gmail.com>
Cc: zlang@redhat.com, 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 07:47:15 -0700	[thread overview]
Message-ID: <20230926144715.GD11456@frogsfrogsfrogs> (raw)
In-Reply-To: <87h6nh5x2o.fsf@doe.com>

On Tue, Sep 26, 2023 at 10:51:19AM +0530, Ritesh Harjani wrote:
> "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.

<nod>

> > +. ./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

Oops, yeah, I'll update the tag.

> 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>

Thanks!

> -ritesh

  reply	other threads:[~2023-09-26 14:47 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
2023-09-26 14:47     ` Darrick J. Wong [this message]
  -- 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=20230926144715.GD11456@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=guan@eryu.me \
    --cc=linux-xfs@vger.kernel.org \
    --cc=ritesh.list@gmail.com \
    --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