From: Nikolay Borisov <nborisov@suse.com>
To: Eryu Guan <eguan@redhat.com>
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH 1/2] initial fiemap test
Date: Tue, 31 Oct 2017 14:27:44 +0200 [thread overview]
Message-ID: <c7949854-d71b-a262-3bea-d42be2667486@suse.com> (raw)
In-Reply-To: <20171031093245.GK17339@eguan.usersys.redhat.com>
On 31.10.2017 11:32, Eryu Guan wrote:
> On Tue, Oct 31, 2017 at 11:22:48AM +0200, Nikolay Borisov wrote:
>>
>>
>> On 27.10.2017 15:44, Eryu Guan wrote:
>>> On Fri, Oct 27, 2017 at 03:37:10PM +0300, Nikolay Borisov wrote:
>>>> Test various range queries of fiemap and ensure they produce expected output.
>>>>
>>>> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
>>>> ---
>>>> tests/xfs/900 | 96 ++++++++++++++++++++++++++++++++++++++++++++
>>>> tests/xfs/900.out | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>> 2 files changed, 214 insertions(+)
>>>> create mode 100755 tests/xfs/900
>>>> create mode 100644 tests/xfs/900.out
>>>>
>>>> diff --git a/tests/xfs/900 b/tests/xfs/900
>>>> new file mode 100755
>>>> index 0000000..e535820
>>>> --- /dev/null
>>>> +++ b/tests/xfs/900
>>>> @@ -0,0 +1,96 @@
>>>> +#! /bin/bash
>>>> +# FS QA Test No. 900
>>>> +#
>>>> +#-----------------------------------------------------------------------
>>>> +# Copyright (c) 2017 SUSE Linux Products GmbH. All Rights Reserved.
>>>> +#
>>>> +# This program is free software; you can redistribute it and/or
>>>> +# modify it under the terms of the GNU General Public License as
>>>> +# published by the Free Software Foundation.
>>>> +#
>>>> +# This program is distributed in the hope that it would be useful,
>>>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
>>>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>>>> +# GNU General Public License for more details.
>>>> +#
>>>> +# You should have received a copy of the GNU General Public License
>>>> +# along with this program; if not, write the Free Software Foundation,
>>>> +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
>>>> +#-----------------------------------------------------------------------
>>>> +#
>>>> +
>>>> +seq=`basename $0`
>>>> +seqres=$RESULT_DIR/$seq
>>>> +echo "QA output created by $seq"
>>>> +
>>>> +here=`pwd`
>>>> +tmp=/tmp/$$
>>>> +status=1 # failure is the default!
>>>> +trap "_cleanup; exit \$status" 0 1 2 3 15
>>>> +
>>>> +_cleanup()
>>>> +{
>>>> + cd /
>>>> + rm -f $tmp.*
>>>> +}
>>>> +
>>>> +# get standard environment, filters and checks
>>>> +. ./common/rc
>>>> +. ./common/punch
>>>> +
>>>> +# remove previous $seqres.full before test
>>>> +rm -f $seqres.full
>>>> +
>>>> +# real QA test starts here
>>>> +
>>>> +# Modify as appropriate.
>>>> +_supported_fs generic
>>>> +_supported_os Linux
>>>> +_require_scratch
>>>> +_require_xfs_io_command "falloc"
>>>> +_require_xfs_io_command "fiemap"
>>>
>>> I haven't run the test yet, but from a quick look, it looks like test
>>> fails with old xfs_io without fiemap range support. Not sure adding
>>> range param to _require_xfs_io_command helps, e.g.
>>>
>>> _require_xfs_io_command "fiemap" "0 4k"
>>
>> Apparently it doesn't :
>> ./io/xfs_io -c "fiemap 0 2k" ../xfstests-dev/trace.dat
>> ../xfstests-dev/trace.dat:
>> 0: [0..6095]: 18477056..18483151
>
> Looks like fiemap ignores all non-option arguments..
>
>>
>>
>> the xfs_io is just v4.13.1 HEAD. One other things that comes to mind is
>> to play tricks with the xfs_io -c "help fiemap" invocation and parse the
>> first line. If the range param is supported then it will be present in
>> the one-line help if not, it won't be. Do you think that's acceptable ?
>
> I'm fine with it, we do have similar code to do such check on help
> message.
This is what I got I just want to run it past you before resending the whole series with the fixes incorporated:
diff --git a/common/rc b/common/rc
index e2a8229..673f9ef 100644
--- a/common/rc
+++ b/common/rc
@@ -2053,8 +2053,15 @@ _require_xfs_io_command()
-c "$command 4k 8k" $testfile 2>&1`
;;
"fiemap")
+ if [ ! -z "$param" ]
+ then
+ $XFS_IO_PROG -c "help fiemap" | head -n 1 | grep -q "[offset [len]]" || \
+ _notrun "xfs_io $command range param support is missing"
+ fi
+
testio=`$XFS_IO_PROG -F -f -c "pwrite 0 20k" -c "fsync" \
-c "fiemap -v $param" $testfile 2>&1`
+
param_checked=1
;;
"flink" )
>
> Thanks,
> Eryu
>
next prev parent reply other threads:[~2017-10-31 12:27 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-27 12:37 [PATCH v2 0/2] Fiemap's range query Nikolay Borisov
2017-10-27 12:37 ` [PATCH 1/2] fiemap: Factor out actual fiemap call code Nikolay Borisov
2017-10-27 16:33 ` Darrick J. Wong
2017-10-27 16:37 ` Darrick J. Wong
2017-10-27 12:37 ` [PATCH 1/2] initial fiemap test Nikolay Borisov
2017-10-27 12:44 ` Eryu Guan
2017-10-31 9:22 ` Nikolay Borisov
2017-10-31 9:32 ` Eryu Guan
2017-10-31 12:27 ` Nikolay Borisov [this message]
2017-10-27 12:37 ` [PATCH 2/2] fiemap: Implement ranged query Nikolay Borisov
2017-10-27 12:37 ` [PATCH 2/2] generic: Adjust generic test ouputs for new fiemap implementation Nikolay Borisov
2017-10-27 12:46 ` Eryu Guan
2017-10-27 12:48 ` Nikolay Borisov
2017-10-31 14:10 ` [PATCH v2 1/2] fiemap: Factor out actual fiemap call code Nikolay Borisov
2017-10-31 14:10 ` [PATCH v2 2/2] fiemap: Implement ranged query Nikolay Borisov
2017-10-31 14:11 ` [PATCH v2 1/4] common: Check for fiemap range argument support Nikolay Borisov
2017-10-31 14:11 ` [PATCH v2 2/4] punch: Implement fixup for fiemap range queries Nikolay Borisov
2017-11-07 5:18 ` Eryu Guan
2017-10-31 14:11 ` [PATCH v2 3/4] generic: Adjust generic test ouputs for new fiemap implementation Nikolay Borisov
2017-11-07 5:15 ` Eryu Guan
2017-10-31 14:11 ` [PATCH v2 4/4] xfs: initial fiemap range query test Nikolay Borisov
2017-11-02 3:16 ` [PATCH v2 1/4] common: Check for fiemap range argument support Eryu Guan
2017-11-02 6:59 ` Nikolay Borisov
2017-11-02 8:13 ` [PATCH v3] " Nikolay Borisov
2017-11-02 21:12 ` Dave Chinner
2017-11-03 14:05 ` Nikolay Borisov
2017-11-03 16:28 ` Darrick J. Wong
2017-11-14 15:09 ` Eric Sandeen
2017-11-15 7:41 ` Eryu Guan
2017-10-31 20:29 ` [PATCH v2 1/2] fiemap: Factor out actual fiemap call code Darrick J. Wong
2017-10-31 20:32 ` Nikolay Borisov
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=c7949854-d71b-a262-3bea-d42be2667486@suse.com \
--to=nborisov@suse.com \
--cc=eguan@redhat.com \
--cc=fstests@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
/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).