From: Namjae Jeon <namjae.jeon@samsung.com>
To: 'Brian Foster' <bfoster@redhat.com>
Cc: 'Theodore Ts'o' <tytso@mit.edu>,
linux-kernel@vger.kernel.org, xfs@oss.sgi.com,
'Ashish Sangwan' <a.sangwan@samsung.com>,
linux-fsdevel@vger.kernel.org,
'linux-ext4' <linux-ext4@vger.kernel.org>
Subject: RE: [PATCH v7 9/11] xfstests: generic/043: Test multiple fallocate insert/collapse range calls
Date: Wed, 07 Jan 2015 14:50:13 +0900 [thread overview]
Message-ID: <001a01d02a3d$ce7462d0$6b5d2870$@samsung.com> (raw)
In-Reply-To: <20150106191010.GJ5874@bfoster.bfoster>
> > +
> > +for (( BSIZE = 1024; BSIZE <= 4096; BSIZE *= 2 )); do
> > +
> > + length=$(($BLOCKS * $BSIZE))
> > + case $FSTYP in
> > + xfs)
> > + _scratch_mkfs -b size=$BSIZE >> $seqres.full 2>&1
> > + ;;
> > + ext4)
> > + _scratch_mkfs -b $BSIZE >> $seqres.full 2>&1
> > + ;;
> > + esac
>
> I think we typically try to define things like blocksize in the test
> configuration. The MKFS_OPTIONS env. var. can be defined with the
> correct options for the associated fs being tested. That eliminates the
> need to loop and for the fs-specific _scratch_mkfs calls above.
Okay, I will change.
>
> > + _scratch_mount >> $seqres.full 2>&1
> > +
> > + # Write file
> > + $XFS_IO_PROG -f -c "pwrite 0 $length" -c fsync $testfile > /dev/null
> > +
> > +
> > + # Insert alternate blocks
>
> Trailing space in the above comment.
>
> > + for (( j=0; j < $(($BLOCKS/2)); j++ )); do
> > + offset=$((($j*$BSIZE)*2))
> > + $XFS_IO_PROG -c "finsert $offset $BSIZE" $testfile > /dev/null
> > + done
> > +
> > + # Check if 100 extents are present
> > + $XFS_IO_PROG -c "fiemap -v" $testfile | grep "^ *[0-9]*:" |wc -l
> > +
> > + _check_scratch_fs
> > + if [ $? -ne 0 ]; then
> > + status=1
> > + exit
> > + fi
> > +
> > + # Collapse alternate blocks
>
> ... and here as well.
Okay, I wil fix both points.
>
> > + for (( j=0; j < $(($BLOCKS/2)); j++ )); do
> > + offset=$((($j*$BSIZE)))
> > + $XFS_IO_PROG -c "fcollapse $offset $BSIZE" $testfile > /dev/null
> > + done
> > +
> > + # Check if 1 extents are present
> > + $XFS_IO_PROG -c "fiemap -v" $testfile | grep "^ *[0-9]*:" |wc -l
> > +
> > + _check_scratch_fs
> > + if [ $? -ne 0 ]; then
> > + status=1
> > + exit
> > + fi
> > +
>
> Maybe create a copy of the original file before we run through the
> insert and collapse sequence and cmp the files here as a last step?
Good idea. I will add your point.
Thanks for your review!
>
> Brian
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
prev parent reply other threads:[~2015-01-07 5:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-02 9:42 [PATCH v7 9/11] xfstests: generic/043: Test multiple fallocate insert/collapse range calls Namjae Jeon
2015-01-06 19:10 ` Brian Foster
2015-01-07 5:50 ` Namjae Jeon [this message]
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='001a01d02a3d$ce7462d0$6b5d2870$@samsung.com' \
--to=namjae.jeon@samsung.com \
--cc=a.sangwan@samsung.com \
--cc=bfoster@redhat.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
--cc=xfs@oss.sgi.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;
as well as URLs for NNTP newsgroup(s).