From: Dave Chinner <david@fromorbit.com>
To: Namjae Jeon <linkinjeon@gmail.com>
Cc: tytso@mit.edu, Namjae Jeon <namjae.jeon@samsung.com>,
linux-kernel@vger.kernel.org, xfs@oss.sgi.com, bpm@sgi.com,
adilger.kernel@dilger.ca, mtk.manpages@gmail.com,
Ashish Sangwan <a.sangwan@samsung.com>,
linux-fsdevel@vger.kernel.org, jack@suse.cz,
linux-ext4@vger.kernel.org, viro@zeniv.linux.org.uk
Subject: Re: [PATCH RESEND 5/10] xfstest: shared/001: Standard collapse range tests
Date: Tue, 4 Feb 2014 10:17:37 +1100 [thread overview]
Message-ID: <20140203231737.GV13997@dastard> (raw)
In-Reply-To: <1391319958-3275-1-git-send-email-linkinjeon@gmail.com>
On Sun, Feb 02, 2014 at 02:45:58PM +0900, Namjae Jeon wrote:
> From: Namjae Jeon <namjae.jeon@samsung.com>
>
> This testcase(001) tries to test various corner cases
> for fcollapse range functionality over different type of extents.
>
> Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
> Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
Couple of things:
> -c "$map_cmd -v" $testfile | $filter_cmd
> [ $? -ne 0 ] && die_now
> _md5_checksum $testfile
> @@ -415,10 +425,10 @@ _test_generic_punch()
> if [ "$remove_testfile" ]; then
> rm -f $testfile
> fi
> - $XFS_IO_PROG -f -c "truncate 20k" \
> - -c "$alloc_cmd 0 8k" \
> - -c "pwrite 8k 8k" $sync_cmd \
> - -c "$zero_cmd 4k 8k" \
> + $XFS_IO_PROG -f -c "truncate $(($multiple * 20))k" \
> + -c "$alloc_cmd 0 $(($multiple * 8))k" \
> + -c "pwrite $(($multiple * 8))k $(($multiple * 8))k" $sync_cmd \
> + -c "$zero_cmd $(($multiple * 4))k $(($multiple * 8))k" \
> -c "$map_cmd -v" $testfile | $filter_cmd
This is unreadable, and therefore I'd consider that these changes
render _test_generic_punch unmaintainable.
Either it needs tobe factored to be more readable, or we need a more
readable way of representing the offsets and sizes if we want them
to be variable. For example:
_4k="$((multiple * 4))k"
_8k="$((multiple * 8))k"
_20k="$((multiple * 20))k"
leads to:
$XFS_IO_PROG -f -c "truncate $_20k" \
-c "$alloc_cmd 0 $_8k" \
-c "pwrite $_8k $_8k" $sync_cmd \
-c "$zero_cmd $_4k $_8k" \
-c "$map_cmd -v" $testfile | $filter_cmd
which is still readable and allows us to arbitrarily scale the
parameters. It even allows us to handle different filesystem block
sizes if we really want to....
> -c "$map_cmd -v" $testfile | $filter_cmd
> [ $? -ne 0 ] && die_now
> _md5_checksum $testfile
>
> + # If zero_cmd is fcollpase, don't check unaligned offsets
> + if [ "$zero_cmd" == "fcollapse" ]; then
> + if [ "$remove_testfile" ]; then
> + rm -f $testfile
> + rm -f $testfile.2
> + fi
> + return
> + fi
No need to remove the test files here - we remove them at
test startup to ensure we have a known initial state....
> +0: [0..63]: extent
> +bb7df04e1b0a2570657527a7e108ae23
> + 13. data -> unwritten -> data
> +0: [0..63]: extent
> +0f0151cbed83e4bf6e5bde26e82ab115
> + 14. data -> hole @ EOF
> +fallocate: Invalid argument
> +0: [0..159]: extent
This error appears in all the golden outputs. If it's correct, then
perhaps it should be filtered out or commented somewhere to explain
why it is expected.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2014-02-03 23:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-02 5:45 [PATCH RESEND 5/10] xfstest: shared/001: Standard collapse range tests Namjae Jeon
2014-02-03 23:17 ` Dave Chinner [this message]
2014-02-04 3:49 ` Namjae Jeon
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=20140203231737.GV13997@dastard \
--to=david@fromorbit.com \
--cc=a.sangwan@samsung.com \
--cc=adilger.kernel@dilger.ca \
--cc=bpm@sgi.com \
--cc=jack@suse.cz \
--cc=linkinjeon@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mtk.manpages@gmail.com \
--cc=namjae.jeon@samsung.com \
--cc=tytso@mit.edu \
--cc=viro@zeniv.linux.org.uk \
--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).