From: Eric Sandeen <sandeen@redhat.com>
To: Eryu Guan <guaneryu@gmail.com>
Cc: fstests <fstests@vger.kernel.org>,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] test online label ioctl
Date: Wed, 9 May 2018 11:18:06 -0500 [thread overview]
Message-ID: <96efb2d0-3cb0-ba1b-35c4-8e6e3df388ac@redhat.com> (raw)
In-Reply-To: <20180509154931.GJ8373@desktop>
On 5/9/18 10:49 AM, Eryu Guan wrote:
> On Mon, Apr 30, 2018 at 04:43:18PM -0500, Eric Sandeen wrote:
>> This tests the online label ioctl that btrfs has, which has been
>> recently proposed for XFS.
>>
>> To run, it requires an updated xfs_io with the label command and a
>> filesystem that supports it
>>
>> A slight change here to _require_xfs_io_command as well, so that tests
>> which simply fail with "Inappropriate ioctl" can be caught in the
>> common case.
>>
>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>> ---
>>
...
>> +# And that it succeeds right at the filesystem max:
>> +case $FSTYP in
>> +xfs)
>> + MAXLEN=12;
>> + ;;
>> +btrfs)
>> + MAXLEN=256
>
> Seems this should be 255, otherwise I got failure like:
>
> -label = "MAXLABEL"
> +label: Invalid argument
>
> and MAXLEN=255 makes the test pass with btrfs.
You are correct, I missed that they exclude the trailing
null from the length. (Sorry, thought I tested this :( )
>> + ;;
>> +*)
>> + MAXLEN=256
>> + echo "Your filesystem supports online label, please add max length"
>
> Perhaps we can introduce a new helper similar to _require_acl_get_max()
> and _notrun the test if current $FSTYP doesn't define a maxlen on
> filesystem label?
Ok, sure.
>> + ;;
>> +esac
>> +LABEL=$(perl -e "print 'o' x $MAXLEN;")
>> +$XFS_IO_PROG -c "label $LABEL" $SCRATCH_MNT | sed -e 's/o\+/MAXLABEL/'
>> +
>> +# And that it fails just past the filesystem max:
>> +let TOOLONG=MAXLEN+1
>> +LABEL=$(perl -e "print 'o' x $TOOLONG;")
>> +$XFS_IO_PROG -c "label $LABEL" $SCRATCH_MNT
>> +
>> +# success, all done
>> +status=0
>> +exit
>> diff --git a/tests/generic/485.out b/tests/generic/485.out
>> new file mode 100644
>> index 0000000..bc54684
>> --- /dev/null
>> +++ b/tests/generic/485.out
>> @@ -0,0 +1,9 @@
>> +QA output created by 485
>> +label = "label.485"
>> +label = "label.485"
>> +SCRATCH_DEV: LABEL="label.485"
>> +SCRATCH_DEV: LABEL="label.485"
>
> There're trailing whitespaces in above two lines, I thought they're the
> output from xfs_io label command at first, but actually I have to remove
> the spaces to make test pass.
It might need a filter, this is output from blkid; it might have changed.
I noticed the whitespace as well but IIRC it works here.
Will look into these and fix stuff up.
Thanks!
-Eric
> Thanks,
> Eryu
>
next prev parent reply other threads:[~2018-05-09 16:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-30 21:43 [PATCH] test online label ioctl Eric Sandeen
2018-05-09 15:49 ` Eryu Guan
2018-05-09 16:18 ` Eric Sandeen [this message]
2018-05-14 17:06 ` Eric Sandeen
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=96efb2d0-3cb0-ba1b-35c4-8e6e3df388ac@redhat.com \
--to=sandeen@redhat.com \
--cc=fstests@vger.kernel.org \
--cc=guaneryu@gmail.com \
--cc=linux-btrfs@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).