From: Jan Kara <jack@suse.cz>
To: Zorro Lang <zlang@redhat.com>
Cc: Jan Kara <jack@suse.cz>,
fstests@vger.kernel.org, Bill O'Donnell <bodonnel@redhat.com>
Subject: Re: [PATCH v2] generic/707: Test moving directory while being grown
Date: Tue, 31 Jan 2023 13:46:35 +0100 [thread overview]
Message-ID: <20230131124635.3oih5pqk3uhwdbo3@quack3> (raw)
In-Reply-To: <20230130160401.aeqxpsn5ndbhiraf@zlang-mailbox>
On Tue 31-01-23 00:04:01, Zorro Lang wrote:
> On Mon, Jan 30, 2023 at 03:56:39PM +0100, Jan Kara wrote:
> > +. ./common/preamble
> > +_begin_fstest auto
> > +
> > +_supported_fs generic
> > +_require_scratch
> > +
> > +_scratch_mkfs >>$seqres.full 2>&1
> > +_scratch_mount
> > +
> > +_cleanup()
> > +{
> > + if [ -n "$BGPID" ]; then
> > + # Stop background process
> > + kill -9 $BGPID &>/dev/null
> > + wait
> > + fi
>
> Neet to keep the code in common/preamble:_cleanup(), if you cover it:
>
> cd /
> rm -f $tmp.*
>
> especially you use pushd and popd.
OK, done.
> I forgot to ask, is this case written for someone known fix or change? If so,
> better to use _fixed_by_kernel_commit or _wants_kernel_commit.
Yes, good point. It tests for UDF & ext4 corruption issue. Ext4 commit is
not yet merged but I'll add there something.
> > +}
> > +
> > +# Loop multiple times trying to hit the race
> > +loops=$((100*TIME_FACTOR))
> > +files=500
> > +moves=500
> > +
> > +create_files()
> > +{
> > + # We use slightly longer file name to make directory grow faster and
> > + # hopefully convert between various types
> > + for (( i = 0; i < $files; i++ )); do
> > + touch somewhatlongerfilename$i
> > + done
> > +}
> > +
> > +for (( i = 0; i <= $moves; i++ )); do
> > + mkdir $SCRATCH_MNT/dir$i
> > +done
> > +
> > +for (( l = 0; l < $loops; l++ )); do
> > + mkdir $SCRATCH_MNT/dir0/dir
> > + pushd $SCRATCH_MNT/dir0/dir &>/dev/null
> > + create_files &
> > + BGPID=$!
> > + popd &>/dev/null
> > + for (( i = 0; i < $moves; i++ )); do
> > + mv $SCRATCH_MNT/dir$i/dir $SCRATCH_MNT/dir$((i+1))/dir
> > + done
> > + wait
> > + BGPID=""
>
> unset BGPID might be better, but anyway :)
Yeah, nicer. Done.
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2023-01-31 12:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 14:56 [PATCH v2] generic/707: Test moving directory while being grown Jan Kara
2023-01-30 16:04 ` Zorro Lang
2023-01-31 12:46 ` Jan Kara [this message]
2023-01-30 16:11 ` Bill O'Donnell
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=20230131124635.3oih5pqk3uhwdbo3@quack3 \
--to=jack@suse.cz \
--cc=bodonnel@redhat.com \
--cc=fstests@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