From: "Lukáš Czerner" <lczerner@redhat.com>
To: Andreas Dilger <adilger@dilger.ca>
Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
xfs@oss.sgi.com
Subject: Re: [PATCH 7/8] xfstests: Add fallocate zero range operation to fsx
Date: Mon, 3 Mar 2014 13:21:03 +0100 (CET) [thread overview]
Message-ID: <alpine.LFD.2.00.1403031317310.2258@localhost.localdomain> (raw)
In-Reply-To: <CB2787E8-CE9B-46BE-B649-4E38ABE27C2B@dilger.ca>
On Fri, 28 Feb 2014, Andreas Dilger wrote:
> Date: Fri, 28 Feb 2014 12:08:47 -0700
> From: Andreas Dilger <adilger@dilger.ca>
> To: Lukas Czerner <lczerner@redhat.com>
> Cc: linux-ext4@vger.kernel.org, xfs@oss.sgi.com, linux-fsdevel@vger.kernel.org
> Subject: Re: [PATCH 7/8] xfstests: Add fallocate zero range operation to fsx
>
> On Feb 28, 2014, at 9:11 AM, Lukas Czerner <lczerner@redhat.com> wrote:
> > This commit adds fallocate FALLOC_FL_ZERO_RANGE support for fsx.
>
> It looks like this patch breaks the option handling for these
> fallocate features.
>
> > int fallocate_calls = 1; /* -F flag disables */
> > int punch_hole_calls = 1; /* -H flag disables */
> > +int zero_range_calls = 1; /* -z flag disables */
>
> So these fallocate tests are on by default...
>
> > \b+int
> > +test_fallocate(int mode)
> > {
> > #ifdef HAVE_LINUX_FALLOC_H
> > + int ret = 0;
> > if (!lite && fallocate_calls) {
^^^^^^^^^^^^^^^
Right, I forgot about this.
> > + if (fallocate(fd, mode, 0, 1) && errno == EOPNOTSUPP) {
> > if(!quiet)
> > warn("main: filesystem does not support fallocate, disabling\n");
> > } else {
> > + ret = 1;
> > ftruncate(fd, 0);
> > }
> > }
> > #endif
> > }
>
> And this returns 1 or 0 depending if they are supported or not...
>
> > + while ((ch = getopt(argc, argv, "b:c:dfl:m:no:p:qr:s:t:w:xyAD:FHzLN:OP:RS:WZ"))
> > != EOF)
> > switch (ch) {
> > case 'H':
> > punch_hole_calls = 0;
> > break;
> > + case 'z':
> > + zero_range_calls = 0;
> > + break;
>
> And the option parsing sets the values to zero if they are disabled,
> so far, so good...
>
> > + fallocate_calls = test_fallocate(0);
> > + punch_hole_calls = test_fallocate(FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE);
> > + zero_range_calls = test_fallocate(FALLOC_FL_ZERO_RANGE);
>
> But here, the values set by option parsing are clobbered and the
> tests are only enabled or disabled depending on whether the kernel
> supports that feature or not. I think you need something like:
Right, and the 'fallocate_calls' test needs to disappear from
test_fallocate().
Thanks!
-Lukas
>
> if (fallocate_calls)
> fallocate_calls = test_fallocate(0);
> if (punch_hole_calls)
> punch_hole_calls = test_fallocate(FALLOC_FL_PUNCH_HOLE |
> FALLOC_FL_KEEP_SIZE);
> if (zero_range_calls)
> zero_range_calls = test_fallocate(FALLOC_FL_ZERO_RANGE);
>
> Cheers, Andreas
>
>
>
>
>
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2014-03-03 12:21 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-28 16:10 [PATCH 1/8] xfstests: Create single function for testing xfs_io commands Lukas Czerner
2014-02-28 16:10 ` [PATCH 2/8] xfstests: create _test_block_boundaries in common/punch Lukas Czerner
2014-02-28 16:11 ` [PATCH 3/8] generic/008: Add test for fallocate zero range at block boundary Lukas Czerner
2014-02-28 16:11 ` [PATCH 4/8] xfstests: Move fallocate include into global.h Lukas Czerner
2014-02-28 17:17 ` Eric Sandeen
2014-02-28 22:31 ` Dave Chinner
2014-02-28 16:11 ` [PATCH 5/8] xfstests: Add fallocate zero range operation to fsstress Lukas Czerner
2014-02-28 17:40 ` Eric Sandeen
2014-03-03 12:16 ` Lukáš Czerner
2014-02-28 16:11 ` [PATCH 6/8] fsstress: translate flags in fiemap_f Lukas Czerner
2014-02-28 17:55 ` Eric Sandeen
2014-02-28 16:11 ` [PATCH 7/8] xfstests: Add fallocate zero range operation to fsx Lukas Czerner
2014-02-28 18:11 ` Eric Sandeen
2014-02-28 19:08 ` Andreas Dilger
2014-03-03 12:21 ` Lukáš Czerner [this message]
2014-02-28 16:11 ` [PATCH 8/8] ext4/001: Add ext4 specific test for fallocate zero range Lukas Czerner
2014-02-28 16:40 ` [PATCH 1/8] xfstests: Create single function for testing xfs_io commands Eric Sandeen
2014-02-28 16:51 ` Lukáš Czerner
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=alpine.LFD.2.00.1403031317310.2258@localhost.localdomain \
--to=lczerner@redhat.com \
--cc=adilger@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--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).