* [PATCH] generic: test that xattrs can have slashes in their names
@ 2019-01-04 21:23 Darrick J. Wong
2019-01-04 21:27 ` Eric Sandeen
2019-01-04 23:14 ` [PATCH v2] " Darrick J. Wong
0 siblings, 2 replies; 6+ messages in thread
From: Darrick J. Wong @ 2019-01-04 21:23 UTC (permalink / raw)
To: Eryu Guan; +Cc: xfs, fstests, Eric Sandeen
From: Darrick J. Wong <darrick.wong@oracle.com>
Eric Sandeen recently found a bug in xfs_repair that flagged extended
attribute names containing "/" as corrupt and purged them. There's
nothing in the IRIX or Linux manuals that say anything about slashes not
being allowed (and Linux certainly allows this) so let's make sure this
continues to work.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
tests/generic/708 | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
tests/generic/708.out | 6 ++++++
tests/generic/group | 1 +
3 files changed, 55 insertions(+)
create mode 100755 tests/generic/708
create mode 100644 tests/generic/708.out
diff --git a/tests/generic/708 b/tests/generic/708
new file mode 100755
index 00000000..ee63ba79
--- /dev/null
+++ b/tests/generic/708
@@ -0,0 +1,48 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0+
+# Copyright (c) 2019 Oracle, Inc. All Rights Reserved.
+#
+# FS QA Test No. 708
+#
+# Check that xattrs can have slashes in their name.
+#
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+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/attr
+. ./common/filter
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_scratch
+_require_attrs
+
+rm -f $seqres.full
+
+_scratch_mkfs >> $seqres.full 2>&1
+_scratch_mount
+
+echo "set attr"
+file=$SCRATCH_MNT/moofile
+touch $file
+setfattr -n "user.boo/hoo" -v "woof" $file
+
+echo "check attr"
+getfattr -d --absolute-names $file | _filter_scratch
+
+# success, all done(?)
+status=0
+exit
diff --git a/tests/generic/708.out b/tests/generic/708.out
new file mode 100644
index 00000000..6978532e
--- /dev/null
+++ b/tests/generic/708.out
@@ -0,0 +1,6 @@
+QA output created by 708
+set attr
+check attr
+# file: SCRATCH_MNT/moofile
+user.boo/hoo="woof"
+
diff --git a/tests/generic/group b/tests/generic/group
index ea5aa7aa..f88125b4 100644
--- a/tests/generic/group
+++ b/tests/generic/group
@@ -525,3 +525,4 @@
520 auto quick log
521 soak long_rw
522 soak long_rw
+708 auto quick attr
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] generic: test that xattrs can have slashes in their names
2019-01-04 21:23 [PATCH] generic: test that xattrs can have slashes in their names Darrick J. Wong
@ 2019-01-04 21:27 ` Eric Sandeen
2019-01-04 22:12 ` Darrick J. Wong
2019-01-04 23:14 ` [PATCH v2] " Darrick J. Wong
1 sibling, 1 reply; 6+ messages in thread
From: Eric Sandeen @ 2019-01-04 21:27 UTC (permalink / raw)
To: Darrick J. Wong, Eryu Guan; +Cc: xfs, fstests, Eric Sandeen
On 1/4/19 3:23 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Eric Sandeen recently found a bug in xfs_repair that flagged extended
> attribute names containing "/" as corrupt and purged them. There's
> nothing in the IRIX or Linux manuals that say anything about slashes not
> being allowed (and Linux certainly allows this) so let's make sure this
> continues to work.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
> tests/generic/708 | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
> tests/generic/708.out | 6 ++++++
> tests/generic/group | 1 +
> 3 files changed, 55 insertions(+)
> create mode 100755 tests/generic/708
> create mode 100644 tests/generic/708.out
>
> diff --git a/tests/generic/708 b/tests/generic/708
> new file mode 100755
> index 00000000..ee63ba79
> --- /dev/null
> +++ b/tests/generic/708
> @@ -0,0 +1,48 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0+
> +# Copyright (c) 2019 Oracle, Inc. All Rights Reserved.
> +#
> +# FS QA Test No. 708
> +#
> +# Check that xattrs can have slashes in their name.
Perhaps a note about what failed before? Because set/get/list has
always(tm) worked:
# (xfs_repair previously flagged this as a corruption)
Is it worth also validating that '/' in a dir entry /is/ still flagged?
Or maybe that's a separate test.
-Eric
> +#
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +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/attr
> +. ./common/filter
> +
> +# real QA test starts here
> +_supported_fs generic
> +_supported_os Linux
> +_require_scratch
> +_require_attrs
> +
> +rm -f $seqres.full
> +
> +_scratch_mkfs >> $seqres.full 2>&1
> +_scratch_mount
> +
> +echo "set attr"
> +file=$SCRATCH_MNT/moofile
> +touch $file
> +setfattr -n "user.boo/hoo" -v "woof" $file
> +
> +echo "check attr"
> +getfattr -d --absolute-names $file | _filter_scratch
> +
> +# success, all done(?)
> +status=0
> +exit
> diff --git a/tests/generic/708.out b/tests/generic/708.out
> new file mode 100644
> index 00000000..6978532e
> --- /dev/null
> +++ b/tests/generic/708.out
> @@ -0,0 +1,6 @@
> +QA output created by 708
> +set attr
> +check attr
> +# file: SCRATCH_MNT/moofile
> +user.boo/hoo="woof"
> +
> diff --git a/tests/generic/group b/tests/generic/group
> index ea5aa7aa..f88125b4 100644
> --- a/tests/generic/group
> +++ b/tests/generic/group
> @@ -525,3 +525,4 @@
> 520 auto quick log
> 521 soak long_rw
> 522 soak long_rw
> +708 auto quick attr
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] generic: test that xattrs can have slashes in their names
2019-01-04 21:27 ` Eric Sandeen
@ 2019-01-04 22:12 ` Darrick J. Wong
2019-01-04 22:21 ` Eric Sandeen
0 siblings, 1 reply; 6+ messages in thread
From: Darrick J. Wong @ 2019-01-04 22:12 UTC (permalink / raw)
To: Eric Sandeen; +Cc: Eryu Guan, xfs, fstests, Eric Sandeen
On Fri, Jan 04, 2019 at 03:27:37PM -0600, Eric Sandeen wrote:
> On 1/4/19 3:23 PM, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> >
> > Eric Sandeen recently found a bug in xfs_repair that flagged extended
> > attribute names containing "/" as corrupt and purged them. There's
> > nothing in the IRIX or Linux manuals that say anything about slashes not
> > being allowed (and Linux certainly allows this) so let's make sure this
> > continues to work.
> >
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> > tests/generic/708 | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
> > tests/generic/708.out | 6 ++++++
> > tests/generic/group | 1 +
> > 3 files changed, 55 insertions(+)
> > create mode 100755 tests/generic/708
> > create mode 100644 tests/generic/708.out
> >
> > diff --git a/tests/generic/708 b/tests/generic/708
> > new file mode 100755
> > index 00000000..ee63ba79
> > --- /dev/null
> > +++ b/tests/generic/708
> > @@ -0,0 +1,48 @@
> > +#! /bin/bash
> > +# SPDX-License-Identifier: GPL-2.0+
> > +# Copyright (c) 2019 Oracle, Inc. All Rights Reserved.
> > +#
> > +# FS QA Test No. 708
> > +#
> > +# Check that xattrs can have slashes in their name.
>
> Perhaps a note about what failed before? Because set/get/list has
> always(tm) worked:
>
> # (xfs_repair previously flagged this as a corruption)
Ok.
> Is it worth also validating that '/' in a dir entry /is/ still flagged?
> Or maybe that's a separate test.
Separate test. The VFS won't let us create a directory entry with a
slash in it, which means we have to scribble on the fs with xfs_db to
set up the test.
--D
> -Eric
>
> > +#
> > +seq=`basename $0`
> > +seqres=$RESULT_DIR/$seq
> > +echo "QA output created by $seq"
> > +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/attr
> > +. ./common/filter
> > +
> > +# real QA test starts here
> > +_supported_fs generic
> > +_supported_os Linux
> > +_require_scratch
> > +_require_attrs
> > +
> > +rm -f $seqres.full
> > +
> > +_scratch_mkfs >> $seqres.full 2>&1
> > +_scratch_mount
> > +
> > +echo "set attr"
> > +file=$SCRATCH_MNT/moofile
> > +touch $file
> > +setfattr -n "user.boo/hoo" -v "woof" $file
> > +
> > +echo "check attr"
> > +getfattr -d --absolute-names $file | _filter_scratch
> > +
> > +# success, all done(?)
> > +status=0
> > +exit
> > diff --git a/tests/generic/708.out b/tests/generic/708.out
> > new file mode 100644
> > index 00000000..6978532e
> > --- /dev/null
> > +++ b/tests/generic/708.out
> > @@ -0,0 +1,6 @@
> > +QA output created by 708
> > +set attr
> > +check attr
> > +# file: SCRATCH_MNT/moofile
> > +user.boo/hoo="woof"
> > +
> > diff --git a/tests/generic/group b/tests/generic/group
> > index ea5aa7aa..f88125b4 100644
> > --- a/tests/generic/group
> > +++ b/tests/generic/group
> > @@ -525,3 +525,4 @@
> > 520 auto quick log
> > 521 soak long_rw
> > 522 soak long_rw
> > +708 auto quick attr
> >
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] generic: test that xattrs can have slashes in their names
2019-01-04 22:12 ` Darrick J. Wong
@ 2019-01-04 22:21 ` Eric Sandeen
0 siblings, 0 replies; 6+ messages in thread
From: Eric Sandeen @ 2019-01-04 22:21 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: Eryu Guan, xfs, fstests, Eric Sandeen
On 1/4/19 4:12 PM, Darrick J. Wong wrote:
> On Fri, Jan 04, 2019 at 03:27:37PM -0600, Eric Sandeen wrote:
>> On 1/4/19 3:23 PM, Darrick J. Wong wrote:
>>> From: Darrick J. Wong <darrick.wong@oracle.com>
>>>
>>> Eric Sandeen recently found a bug in xfs_repair that flagged extended
>>> attribute names containing "/" as corrupt and purged them. There's
>>> nothing in the IRIX or Linux manuals that say anything about slashes not
>>> being allowed (and Linux certainly allows this) so let's make sure this
>>> continues to work.
>>>
>>> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
>>> ---
>>> tests/generic/708 | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
>>> tests/generic/708.out | 6 ++++++
>>> tests/generic/group | 1 +
>>> 3 files changed, 55 insertions(+)
>>> create mode 100755 tests/generic/708
>>> create mode 100644 tests/generic/708.out
>>>
>>> diff --git a/tests/generic/708 b/tests/generic/708
>>> new file mode 100755
>>> index 00000000..ee63ba79
>>> --- /dev/null
>>> +++ b/tests/generic/708
>>> @@ -0,0 +1,48 @@
>>> +#! /bin/bash
>>> +# SPDX-License-Identifier: GPL-2.0+
>>> +# Copyright (c) 2019 Oracle, Inc. All Rights Reserved.
>>> +#
>>> +# FS QA Test No. 708
>>> +#
>>> +# Check that xattrs can have slashes in their name.
>>
>> Perhaps a note about what failed before? Because set/get/list has
>> always(tm) worked:
>>
>> # (xfs_repair previously flagged this as a corruption)
>
> Ok.
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
(fine by me if that little change goes in on commit, not that important
but adds some clarity about what got fixed IMHO)
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] generic: test that xattrs can have slashes in their names
2019-01-04 21:23 [PATCH] generic: test that xattrs can have slashes in their names Darrick J. Wong
2019-01-04 21:27 ` Eric Sandeen
@ 2019-01-04 23:14 ` Darrick J. Wong
2019-01-07 9:59 ` Carlos Maiolino
1 sibling, 1 reply; 6+ messages in thread
From: Darrick J. Wong @ 2019-01-04 23:14 UTC (permalink / raw)
To: Eryu Guan; +Cc: xfs, fstests, Eric Sandeen
From: Darrick J. Wong <darrick.wong@oracle.com>
Eric Sandeen recently found a bug in xfs_repair that flagged extended
attribute names containing "/" as corrupt and purged them. There's
nothing in the IRIX or Linux manuals that say anything about slashes not
being allowed (and Linux certainly allows this) so let's make sure this
continues to work.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
---
tests/generic/708 | 50 +++++++++++++++++++++++++++++++++++++++++++++++++
tests/generic/708.out | 6 ++++++
tests/generic/group | 1 +
3 files changed, 57 insertions(+)
create mode 100755 tests/generic/708
create mode 100644 tests/generic/708.out
diff --git a/tests/generic/708 b/tests/generic/708
new file mode 100755
index 00000000..c32f966c
--- /dev/null
+++ b/tests/generic/708
@@ -0,0 +1,50 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0+
+# Copyright (c) 2019 Oracle, Inc. All Rights Reserved.
+#
+# FS QA Test No. 708
+#
+# Check that xattrs can have slashes in their name.
+#
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+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/attr
+. ./common/filter
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_scratch
+_require_attrs
+
+rm -f $seqres.full
+
+_scratch_mkfs >> $seqres.full 2>&1
+_scratch_mount
+
+echo "set attr"
+file=$SCRATCH_MNT/moofile
+touch $file
+setfattr -n "user.boo/hoo" -v "woof" $file
+
+echo "check attr"
+getfattr -d --absolute-names $file | _filter_scratch
+
+# Now we let the fsck tool check the filesystem, because xfs_repair had a
+# regression where it would flag and erase any xattr with a '/' in it.
+
+status=0
+exit
diff --git a/tests/generic/708.out b/tests/generic/708.out
new file mode 100644
index 00000000..6978532e
--- /dev/null
+++ b/tests/generic/708.out
@@ -0,0 +1,6 @@
+QA output created by 708
+set attr
+check attr
+# file: SCRATCH_MNT/moofile
+user.boo/hoo="woof"
+
diff --git a/tests/generic/group b/tests/generic/group
index ea5aa7aa..f88125b4 100644
--- a/tests/generic/group
+++ b/tests/generic/group
@@ -525,3 +525,4 @@
520 auto quick log
521 soak long_rw
522 soak long_rw
+708 auto quick attr
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] generic: test that xattrs can have slashes in their names
2019-01-04 23:14 ` [PATCH v2] " Darrick J. Wong
@ 2019-01-07 9:59 ` Carlos Maiolino
0 siblings, 0 replies; 6+ messages in thread
From: Carlos Maiolino @ 2019-01-07 9:59 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: Eryu Guan, xfs, fstests, Eric Sandeen
On Fri, Jan 04, 2019 at 03:14:48PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Eric Sandeen recently found a bug in xfs_repair that flagged extended
> attribute names containing "/" as corrupt and purged them. There's
> nothing in the IRIX or Linux manuals that say anything about slashes not
> being allowed (and Linux certainly allows this) so let's make sure this
> continues to work.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> Reviewed-by: Eric Sandeen <sandeen@redhat.com>
> ---
> tests/generic/708 | 50 +++++++++++++++++++++++++++++++++++++++++++++++++
> tests/generic/708.out | 6 ++++++
> tests/generic/group | 1 +
> 3 files changed, 57 insertions(+)
> create mode 100755 tests/generic/708
> create mode 100644 tests/generic/708.out
>
> diff --git a/tests/generic/708 b/tests/generic/708
> new file mode 100755
> index 00000000..c32f966c
> --- /dev/null
> +++ b/tests/generic/708
> @@ -0,0 +1,50 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0+
> +# Copyright (c) 2019 Oracle, Inc. All Rights Reserved.
> +#
> +# FS QA Test No. 708
> +#
> +# Check that xattrs can have slashes in their name.
> +#
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +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/attr
> +. ./common/filter
> +
> +# real QA test starts here
> +_supported_fs generic
> +_supported_os Linux
> +_require_scratch
> +_require_attrs
> +
> +rm -f $seqres.full
> +
> +_scratch_mkfs >> $seqres.full 2>&1
> +_scratch_mount
> +
> +echo "set attr"
> +file=$SCRATCH_MNT/moofile
> +touch $file
> +setfattr -n "user.boo/hoo" -v "woof" $file
[off-topic] I love your creativity for naming :D
> +
> +echo "check attr"
> +getfattr -d --absolute-names $file | _filter_scratch
> +
> +# Now we let the fsck tool check the filesystem, because xfs_repair had a
> +# regression where it would flag and erase any xattr with a '/' in it.
> +
I'd prefer this to be in the beginning of the test description instead of
'hidden' in the middle of the code, so, it's easily accessible via 'grep'.
But the test itself looks good, and I don't think this change is worth a V3, so
if you want, you could move it to the test description before merging, or ignore
my suggestion completely :P
But anyway, you can add:
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Cheers
--
Carlos
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-01-07 9:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-04 21:23 [PATCH] generic: test that xattrs can have slashes in their names Darrick J. Wong
2019-01-04 21:27 ` Eric Sandeen
2019-01-04 22:12 ` Darrick J. Wong
2019-01-04 22:21 ` Eric Sandeen
2019-01-04 23:14 ` [PATCH v2] " Darrick J. Wong
2019-01-07 9:59 ` Carlos Maiolino
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).