Skip to contentSkip to conversation

xfstests XFS: verify extended attributes after multi-stream xfsdump/xfsrestore are not lost

PATCH Superseded [email protected] 3 participants 16 messages Oct 11, 2013 – Oct 24, 2013

lore
Share & tools
lore
#0 lore raw

v3 cover xfstests XFS: verify extended attributes after multi-stream xfsdump/xfsrestore are not lost

Extended attributes are lost after multi-stream xfsdump/xfsrestore of wholly-sparse files. This can happen in two ways:

1 - The restore succeeds, however the extended attributes are lost 2 - The restore in not successful because xfsrestore segfaults
with the following warning:

"partial_reg: Out of records. Extend attrs applied early."

---
Changelog
V2:
Updated test description and comments Changed test status to default to failure Added missing _requires_XXXX statements Removed the attr root (-R) namespace argument
V3:
Split into 2 tests and used functions from the common directory where appropriate.

--Rich

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw

PATCH v3 1/2 xfstests XFS: verify extended attributes after multi-stream xfsdump/xfsrestore

Verify extended attributes are not lost after multi-stream xfsdump/xfsrestore of wholly-sparse files. The restore succeeds, however the extended attributes for that file are lost.

tests/xfs/350 new file +72 -0
new file mode 100755
index 0000000..88943e4
@@ -0,0 +1,72 @@
+#! /bin/bash
+# FS QA Test No. 350
+#
+# Verify multi-stream xfsdump/restore preserves extended attributes
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 Red Hat, Inc.  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/filter
+. ./common/dump
+. ./common/attr
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs xfs
+_supported_os Linux
+_require_scratch
+
+# Extended attributes
+attr_name=attrname
+attr_value=1234
+
+rm -f $seqres.full
+
+_create_dumpdir_fill_ea 2>&1 >> $seqres.full
+
+# Create and add wholly-sparse file to the dump directory
+$XFS_IO_PROG -f -c "truncate 1t" $dump_dir/sparsefile 2>&1 >> $seqres.full ||
+_fail "could not create \"$dump_dir\"/sparsefile"
+
+# Set the xattr on sparsefile
+$ATTR_PROG -s $attr_name -V $attr_value $dump_dir/sparsefile 2>&1 >> $seqres.full || _fail "could not set ATTR for \"$dump_dir\"/sparsefile"
+
+_do_dump_multi_file --multi 4  2>&1 >> $seqres.full
+_do_restore_multi_file --multi 4 2>&1 >> $seqres.full
+_diff_compare_eas 
+
+status=0
+exit 
tests/xfs/350.out new file +34 -0
new file mode 100644
index 0000000..6798ded
@@ -0,0 +1,34 @@
+QA output created by 350
+Comparing dump directory with restore directory
+Looking at the extended attributes (EAs)
+EAs on dump
+User names
+Attribute "attr5" had a 8 byte value for DUMP_DIR/dir:
+dir_text
+Attribute "attr1" had a 9 byte value for DUMP_DIR/smalll:
+some_text
+Attribute "attrname" had a 4 byte value for DUMP_DIR/sparsefile:
+1234
+Attribute "attr3" had a 10 byte value for DUMP_DIR/sub/smalll:
+some_text3
+Root names
+Attribute "attr2" had a 10 byte value for DUMP_DIR/biggg:
+some_text2
+Attribute "attr4" had a 10 byte value for DUMP_DIR/sub/biggg:
+some_text4
+EAs on restore
+User names
+Attribute "attr5" had a 8 byte value for DUMP_DIR/dir:
+dir_text
+Attribute "attr1" had a 9 byte value for DUMP_DIR/smalll:
+some_text
+Attribute "attrname" had a 4 byte value for DUMP_DIR/sparsefile:
+1234
+Attribute "attr3" had a 10 byte value for DUMP_DIR/sub/smalll:
+some_text3
+Root names
+Attribute "attr2" had a 10 byte value for DUMP_DIR/biggg:
+some_text2
+Attribute "attr4" had a 10 byte value for DUMP_DIR/sub/biggg:
+some_text4
+Files 350.ea1 and 350.ea2 are identical
tests/xfs/group +1 -0
index 352a4c5..2cd3cf0 100644
@@ -179,3 +179,4 @@
 297 auto freeze
 298 auto attr symlink quick
 299 auto quota
+350 dump auto

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#6 lore raw

PATCH v3 2/2 xfstests: xfsdump/restore test for partial_reg: Out of records. Extend attrs applied early

In reply to [email protected]

Multi-stream xfsdump/xfsrestore of more than partialmax wholly-sparse files segfaults with the following warning:

"partial_reg: Out of records. Extend attrs applied early."

Add a test that dumps and restores partialmax + 1 wholly-sparse files.

tests/xfs/351 new file +71 -0
new file mode 100755
index 0000000..43b14c2
@@ -0,0 +1,71 @@
+#! /bin/bash
+# FS QA Test No. 351
+#
+# Dump and restore partialmax + 1 wholly-sparse files
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 SGI.  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/filter
+. ./common/dump
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs xfs
+_supported_os Linux
+_require_scratch
+#dump_dir=/mnt/test/$dump_sdir
+
+rm -f $seqres.full
+rm -rf $restore_dir/*
+rm -f $tmp.stream? 
+
+echo "Silence is golden."
+_wipe_fs
+mkdir $dump_dir 2>&1 >> $seqres.full || _fail "mkdir \"$dump_dir\" failed"
+for i in `seq 1 4`; do
+	$XFS_IO_PROG -f -c "truncate 1t" $dump_dir/sparsefile$i \
+		2>&1 >> $seqres.full || _fail "failed to create sparsefile\"$i\""
+done
+# Dump and restore the files
+_prepare_restore_dir
+$XFSDUMP_PROG -L session -M label1 -M label2 -f $tmp.stream1 \
+	-f $tmp.stream2 $SCRATCH_MNT -s $dump_sdir \
+	2>&1 >> $seqres.full || _fail "dump failed"
+$XFSRESTORE_PROG -F -f $tmp.stream1 -f $tmp.stream2 $restore_dir \
+	2>&1 >> $seqres.full || _fail "restore failed"
+status=0
+exit 
tests/xfs/351.out new file +2 -0
new file mode 100644
index 0000000..42cf52e
@@ -0,0 +1,2 @@
+QA output created by 351
+Silence is golden.
tests/xfs/group +1 -0
index 352a4c5..3e73f1d 100644
@@ -179,3 +179,4 @@
 297 auto freeze
 298 auto attr symlink quick
 299 auto quota
+351 auto dump

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#2 lore raw

Re: [PATCH 1/2] xfstests XFS: verify extended attributes after multi-stream xfsdump/xfsrestore

In reply to [email protected]
Quoted 64 lines · On 10/10/13 11:19 PM, [email protected] wrote:

Verify extended attributes are not lost after multi-stream xfsdump/xfsrestore of wholly-sparse files. The restore succeeds, however the extended attributes for that file are lost.

tests/xfs/350 new file +52 -0
new file mode 100755
index 0000000..88943e4
@@ -0,0 +1,72 @@
+#! /bin/bash
+# FS QA Test No. 350
+#
+# Verify multi-stream xfsdump/restore preserves extended attributes
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 Red Hat, Inc.  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/filter
+. ./common/dump
+. ./common/attr
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs xfs
+_supported_os Linux
+_require_scratch
+
+# Extended attributes

tests/xfs/350 line 62

Quoted 10 lines
tests/xfs/350 new file +10 -0
+attr_name=attrname
+attr_value=1234
+
+rm -f $seqres.full
+
+_create_dumpdir_fill_ea 2>&1 >> $seqres.full
+
+# Create and add wholly-sparse file to the dump directory
+$XFS_IO_PROG -f -c "truncate 1t" $dump_dir/sparsefile 2>&1 >> $seqres.full ||
+_fail "could not create \"$dump_dir\"/sparsefile"

I . . guess that works w/o a continuation? I'd have done this; note also the 2>&1 needs to go after the file redirect
(http://www.tldp.org/LDP/abs/html/io-redirection.html)

+$XFS_IO_PROG -f -c "truncate 1t" $dump_dir/sparsefile >> $seqres.full 2>&1 || \
+ _fail "could not create \"$dump_dir\"/sparsefile"

but my bash-fu is weak, so not sure about the continuation part. Can't hurt? :)

tests/xfs/350 line 65

Quoted 3 lines
tests/xfs/350 new file +3 -0
+
+# Set the xattr on sparsefile
+$ATTR_PROG -s $attr_name -V $attr_value $dump_dir/sparsefile 2>&1 >> $seqres.full || _fail "could not set ATTR for \"$dump_dir\"/sparsefile"

same deal for the redirect: ">> $seqres.full 2>&1"

tests/xfs/350 line 68

Quoted 3 lines
tests/xfs/350 new file +3 -0
+
+_do_dump_multi_file --multi 4  2>&1 >> $seqres.full
+_do_restore_multi_file --multi 4 2>&1 >> $seqres.full

">> $seqres.full 2>&1"

Nitpicks, I guess, but if you wouldn't mind one more round...

-Eric

Quoted 55 lines
tests/xfs/350 new file +4 -0
+_diff_compare_eas 
+
+status=0
+exit 
tests/xfs/350.out new file +34 -0
new file mode 100644
index 0000000..6798ded
@@ -0,0 +1,34 @@
+QA output created by 350
+Comparing dump directory with restore directory
+Looking at the extended attributes (EAs)
+EAs on dump
+User names
+Attribute "attr5" had a 8 byte value for DUMP_DIR/dir:
+dir_text
+Attribute "attr1" had a 9 byte value for DUMP_DIR/smalll:
+some_text
+Attribute "attrname" had a 4 byte value for DUMP_DIR/sparsefile:
+1234
+Attribute "attr3" had a 10 byte value for DUMP_DIR/sub/smalll:
+some_text3
+Root names
+Attribute "attr2" had a 10 byte value for DUMP_DIR/biggg:
+some_text2
+Attribute "attr4" had a 10 byte value for DUMP_DIR/sub/biggg:
+some_text4
+EAs on restore
+User names
+Attribute "attr5" had a 8 byte value for DUMP_DIR/dir:
+dir_text
+Attribute "attr1" had a 9 byte value for DUMP_DIR/smalll:
+some_text
+Attribute "attrname" had a 4 byte value for DUMP_DIR/sparsefile:
+1234
+Attribute "attr3" had a 10 byte value for DUMP_DIR/sub/smalll:
+some_text3
+Root names
+Attribute "attr2" had a 10 byte value for DUMP_DIR/biggg:
+some_text2
+Attribute "attr4" had a 10 byte value for DUMP_DIR/sub/biggg:
+some_text4
+Files 350.ea1 and 350.ea2 are identical
tests/xfs/group +1 -0
index 352a4c5..2cd3cf0 100644
@@ -179,3 +179,4 @@
 297 auto freeze
 298 auto attr symlink quick
 299 auto quota
+350 dump auto
Quoted 5 lines

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#3 lore raw

Re: [PATCH 1/2] xfstests XFS: verify extended attributes after multi-stream xfsdump/xfsrestore

Quoted 63 lines · Eric Sandeen
Quoted 62 lines · On 10/10/13 11:19 PM, [email protected] wrote:

Verify extended attributes are not lost after multi-stream xfsdump/xfsrestore of wholly-sparse files. The restore succeeds, however the extended attributes for that file are lost.

tests/xfs/350 new file +50 -0
new file mode 100755
index 0000000..88943e4
@@ -0,0 +1,72 @@
+#! /bin/bash
+# FS QA Test No. 350
+#
+# Verify multi-stream xfsdump/restore preserves extended attributes
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 Red Hat, Inc.  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/filter
+. ./common/dump
+. ./common/attr
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs xfs
+_supported_os Linux
+_require_scratch
Quoted 8 lines

tests/xfs/350 line 58

Quoted 8 lines
tests/xfs/350 new file +8 -0
+
+# Extended attributes
+attr_name=attrname
+attr_value=1234
+
+rm -f $seqres.full
+
+_create_dumpdir_fill_ea 2>&1 >> $seqres.full

whoops here too. Tho I think _create_dumpdir_fill_ea already does all the redirect you need.

Was going to say you need a scratch_mkfs & mount too, but _create_dumpdir_fill_ea() does all that under the covers? Bleah! Comment to that effect wouldn't hurt.

-Eric

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#7 lore raw

Re: [PATCH 2/2] xfstests: xfsdump/restore test for partial_reg: Out of records. Extend attrs applied early

In reply to [email protected]
Quoted 55 lines · On 10/10/13 11:19 PM, [email protected] wrote:

Multi-stream xfsdump/xfsrestore of more than partialmax wholly-sparse files segfaults with the following warning:

"partial_reg: Out of records. Extend attrs applied early."

Add a test that dumps and restores partialmax + 1 wholly-sparse files.

tests/xfs/351 new file +40 -0
new file mode 100755
index 0000000..43b14c2
@@ -0,0 +1,71 @@
+#! /bin/bash
+# FS QA Test No. 351
+#
+# Dump and restore partialmax + 1 wholly-sparse files
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 SGI.  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

tests/xfs/351 line 50

Quoted 10 lines
tests/xfs/351 new file +10 -0
+. ./common/filter
+. ./common/dump
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs xfs
+_supported_os Linux
+_require_scratch
+#dump_dir=/mnt/test/$dump_sdir

remove the commented-out line?

tests/xfs/351 line 53

Quoted 3 lines
tests/xfs/351 new file +3 -0
+
+rm -f $seqres.full
+rm -rf $restore_dir/*

eek, who sets $restore_dir? Oh, sourcing common/dump does. But nothing mounts $SCRATCH_DEV yet, right? So this seems like a combination of incorrect, unnecessary & dangerous. (_wipe_fs will re-mkfs anyway). I'd just remove it.

tests/xfs/351 line 54

Quoted 1 line
tests/xfs/351 new file +1 -0
+rm -f $tmp.stream? 

$tmp is /tmp/<our pid>

so /tmp/<our pid>.stream *really* shouldn't exist, and cleanup should have removed it from the last run (with a different pid).

But I suppose it doesn't hurt to be sure...

tests/xfs/351 line 57

Quoted 3 lines
tests/xfs/351 new file +3 -0
+
+echo "Silence is golden."
+_wipe_fs

Ok, wipe_fs does mkfs & mount. Could you add a comment?

tests/xfs/351 line 58

Quoted 1 line
tests/xfs/351 new file +1 -0
+mkdir $dump_dir 2>&1 >> $seqres.full || _fail "mkdir \"$dump_dir\" failed"

same deal w/ the order of the redirects. More below too.

Otherwise looks ok.

-Eric

Quoted 32 lines
tests/xfs/351 new file +13 -0
+for i in `seq 1 4`; do
+	$XFS_IO_PROG -f -c "truncate 1t" $dump_dir/sparsefile$i \
+		2>&1 >> $seqres.full || _fail "failed to create sparsefile\"$i\""
+done
+# Dump and restore the files
+_prepare_restore_dir
+$XFSDUMP_PROG -L session -M label1 -M label2 -f $tmp.stream1 \
+	-f $tmp.stream2 $SCRATCH_MNT -s $dump_sdir \
+	2>&1 >> $seqres.full || _fail "dump failed"
+$XFSRESTORE_PROG -F -f $tmp.stream1 -f $tmp.stream2 $restore_dir \
+	2>&1 >> $seqres.full || _fail "restore failed"
+status=0
+exit 
tests/xfs/351.out new file +2 -0
new file mode 100644
index 0000000..42cf52e
@@ -0,0 +1,2 @@
+QA output created by 351
+Silence is golden.
tests/xfs/group +1 -0
index 352a4c5..3e73f1d 100644
@@ -179,3 +179,4 @@
 297 auto freeze
 298 auto attr symlink quick
 299 auto quota
+351 auto dump
Quoted 5 lines

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#4 lore raw

Re: [PATCH 1/2] xfstests XFS: verify extended attributes after multi-stream xfsdump/xfsrestore

In reply to Eric Sandeen
Quoted 76 lines · Eric Sandeen
Quoted 63 lines · Eric Sandeen
Quoted 62 lines · On 10/10/13 11:19 PM, [email protected] wrote:

Verify extended attributes are not lost after multi-stream xfsdump/xfsrestore of wholly-sparse files. The restore succeeds, however the extended attributes for that file are lost.

tests/xfs/350 new file +50 -0
new file mode 100755
index 0000000..88943e4
@@ -0,0 +1,72 @@
+#! /bin/bash
+# FS QA Test No. 350
+#
+# Verify multi-stream xfsdump/restore preserves extended attributes
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 Red Hat, Inc.  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/filter
+. ./common/dump
+. ./common/attr
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs xfs
+_supported_os Linux
+_require_scratch
Quoted 8 lines

tests/xfs/350 line 58

Quoted 8 lines
tests/xfs/350 new file +8 -0
+
+# Extended attributes
+attr_name=attrname
+attr_value=1234
+
+rm -f $seqres.full
+
+_create_dumpdir_fill_ea 2>&1 >> $seqres.full

whoops here too. Tho I think _create_dumpdir_fill_ea already does all the redirect you need.

Quoted 3 lines

Was going to say you need a scratch_mkfs & mount too, but _create_dumpdir_fill_ea() does all that under the covers? Bleah! Comment to that effect wouldn't hurt.

All the dump/restore tests do this. It's common code, so once you know it for one, it's obvious for the rest. Hence addin a comment in just this test would be kinda strange...

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#5 lore raw

Re: [PATCH 1/2] xfstests XFS: verify extended attributes after multi-stream xfsdump/xfsrestore

Quoted 3 lines · Dave Chinner

All the dump/restore tests do this. It's common code, so once you know it for one, it's obvious for the rest. Hence addin a comment in just this test would be kinda strange...

Meh, ok. So I have to know it, eh? ;)

Fine by me, then.

-Eric

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#8 lore raw

v4 cover xfstests XFS: verify extended attributes after multi-stream xfsdump/xfsrestore are not lost

In reply to [email protected]

Extended attributes are lost after multi-stream xfsdump/xfsrestore of wholly-sparse files. This can happen in two ways:

1 - The restore succeeds, however the extended attributes are lost 2 - The restore in not successful because xfsrestore segfaults
with the following warning:

"partial_reg: Out of records. Extend attrs applied
early."

---
Changelog
V2:
Updated test description and comments Changed test status to default to failure Added missing _requires_XXXX statements Removed the attr root (-R) namespace argument
V3:
Split into 2 tests and used functions from the common directory where appropriate.

--Rich

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#12 lore raw

PATCH v4 2/2 xfstests: xfsdump/restore test for partial_reg: Out of records. Extend attrs applied early

Multi-stream xfsdump/xfsrestore of more than partialmax wholly-sparse files segfaults with the following warning:

"partial_reg: Out of records. Extend attrs applied early."

Add a test that dumps and restores partialmax + 1 wholly-sparse files.

---

tests/xfs/351 new file +68 -0
new file mode 100755
index 0000000..c0d8afb
@@ -0,0 +1,68 @@
+#! /bin/bash
+# FS QA Test No. 351
+#
+# Dump and restore partialmax + 1 wholly-sparse files
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 SGI.  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/filter
+. ./common/dump
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs xfs
+_supported_os Linux
+_require_scratch
+
+rm -f $seqres.full
+
+echo "Silence is golden."
+_wipe_fs
+mkdir $dump_dir >> $seqres.full 2>&1 || _fail "mkdir \"$dump_dir\" failed"
+for i in `seq 1 4`; do
+	$XFS_IO_PROG -f -c "truncate 1t" $dump_dir/sparsefile$i \
+		>> $seqres.full 2>&1 || _fail "failed to create sparsefile\"$i\""
+done
+# Dump and restore the files
+_prepare_restore_dir
+$XFSDUMP_PROG -L session -M label1 -M label2 -f $tmp.stream1 \
+	-f $tmp.stream2 $SCRATCH_MNT -s $dump_sdir \
+	>> $seqres.full 2>&1 || _fail "dump failed"
+$XFSRESTORE_PROG -F -f $tmp.stream1 -f $tmp.stream2 $restore_dir \
+	>> $seqres.full 2>&1 || _fail "restore failed"
+status=0
+exit 
tests/xfs/351.out new file +2 -0
new file mode 100644
index 0000000..42cf52e
@@ -0,0 +1,2 @@
+QA output created by 351
+Silence is golden.
tests/xfs/group +1 -0
index 17fff27..53ea498 100644
@@ -179,3 +179,4 @@
 297 auto freeze
 298 auto attr symlink quick
 299 auto quota
+351 auto dump

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#9 lore raw

PATCH v4 1/2 xfstests XFS: verify extended attributes after multi-stream xfsdump/xfsrestore

In reply to [email protected]

Verify extended attributes are not lost after multi-stream xfsdump/xfsrestore of wholly-sparse files. The restore succeeds, however the extended attributes for that file are lost.

tests/xfs/350 new file +73 -0
new file mode 100755
index 0000000..df4c258
@@ -0,0 +1,73 @@
+#! /bin/bash
+# FS QA Test No. 350
+#
+# Verify multi-stream xfsdump/restore preserves extended attributes
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 Red Hat, Inc.  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/filter
+. ./common/dump
+. ./common/attr
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs xfs
+_supported_os Linux
+_require_scratch
+
+# Extended attributes
+attr_name=attrname
+attr_value=1234
+
+rm -f $seqres.full
+
+_create_dumpdir_fill_ea
+
+# Create and add wholly-sparse file to the dump directory
+$XFS_IO_PROG -f -c "truncate 1t" $dump_dir/sparsefile >> $seqres.full 2>&1 \
+	|| _fail "could not create \"$dump_dir\"/sparsefile"
+
+# Set the xattr on sparsefile
+$ATTR_PROG -s $attr_name -V $attr_value $dump_dir/sparsefile >> $seqres.full 2>&1 \
+	|| _fail "could not set ATTR for \"$dump_dir\"/sparsefile"
+
+_do_dump_multi_file --multi 4  >> $seqres.full 2>&1
+_do_restore_multi_file --multi 4 >> $seqres.full 2>&1
+_diff_compare_eas
+
+status=0
+exit
tests/xfs/350.out new file +46 -0

46 lines not on this page · raw message

tests/xfs/group +1 -0
index 17fff27..efa025d 100644
@@ -179,3 +179,4 @@
 297 auto freeze
 298 auto attr symlink quick
 299 auto quota
+350 auto dump

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#15 lore raw
In reply to [email protected]
Quoted 10 lines · On 10/21/2013 03:02 PM, [email protected] wrote:

Extended attributes are lost after multi-stream xfsdump/xfsrestore of wholly-sparse files. This can happen in two ways:

1 - The restore succeeds, however the extended attributes are lost 2 - The restore in not successful because xfsrestore segfaults
with the following warning:

"partial_reg: Out of records. Extend attrs applied
early."

Quoted 11 lines

---
Changelog
V2:
Updated test description and comments Changed test status to default to failure Added missing _requires_XXXX statements Removed the attr root (-R) namespace argument
V3:
Split into 2 tests and used functions from the common directory where appropriate.

V4:
Addressed Eric's comments

Quoted 7 lines

--Rich

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v4 1/2
#10 lore raw

Re: [PATCH V4 1/2] xfstests XFS: verify extended attributes after multi-stream xfsdump/xfsrestore

In reply to [email protected]
Quoted 5 lines · On 10/21/13 3:02 PM, [email protected] wrote:

Verify extended attributes are not lost after multi-stream xfsdump/xfsrestore of wholly-sparse files. The restore succeeds, however the extended attributes for that file are lost.

Quoted 142 lines
tests/xfs/350 new file +73 -0
new file mode 100755
index 0000000..df4c258
@@ -0,0 +1,73 @@
+#! /bin/bash
+# FS QA Test No. 350
+#
+# Verify multi-stream xfsdump/restore preserves extended attributes
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 Red Hat, Inc.  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/filter
+. ./common/dump
+. ./common/attr
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs xfs
+_supported_os Linux
+_require_scratch
+
+# Extended attributes
+attr_name=attrname
+attr_value=1234
+
+rm -f $seqres.full
+
+_create_dumpdir_fill_ea
+
+# Create and add wholly-sparse file to the dump directory
+$XFS_IO_PROG -f -c "truncate 1t" $dump_dir/sparsefile >> $seqres.full 2>&1 \
+	|| _fail "could not create \"$dump_dir\"/sparsefile"
+
+# Set the xattr on sparsefile
+$ATTR_PROG -s $attr_name -V $attr_value $dump_dir/sparsefile >> $seqres.full 2>&1 \
+	|| _fail "could not set ATTR for \"$dump_dir\"/sparsefile"
+
+_do_dump_multi_file --multi 4  >> $seqres.full 2>&1
+_do_restore_multi_file --multi 4 >> $seqres.full 2>&1
+_diff_compare_eas
+
+status=0
+exit
tests/xfs/350.out new file +46 -0
new file mode 100644
index 0000000..31a88b8
@@ -0,0 +1,46 @@
+QA output created by 350
+Creating directory system to dump using src/fill.
+Setup Attribute "attr1" set to a 9 byte value for smalll:
+some_text
+.Attribute "attr2" set to a 10 byte value for biggg:
+some_text2
+.Attribute "attr3" set to a 10 byte value for sub/smalll:
+some_text3
+.Attribute "attr4" set to a 10 byte value for sub/biggg:
+some_text4
+.Attribute "attr5" set to a 8 byte value for dir:
+dir_text
+...............
+Comparing dump directory with restore directory
+Looking at the extended attributes (EAs)
+EAs on dump
+User names
+Attribute "attr5" had a 8 byte value for DUMP_DIR/dir:
+dir_text
+Attribute "attr1" had a 9 byte value for DUMP_DIR/smalll:
+some_text
+Attribute "attrname" had a 4 byte value for DUMP_DIR/sparsefile:
+1234
+Attribute "attr3" had a 10 byte value for DUMP_DIR/sub/smalll:
+some_text3
+Root names
+Attribute "attr2" had a 10 byte value for DUMP_DIR/biggg:
+some_text2
+Attribute "attr4" had a 10 byte value for DUMP_DIR/sub/biggg:
+some_text4
+EAs on restore
+User names
+Attribute "attr5" had a 8 byte value for DUMP_DIR/dir:
+dir_text
+Attribute "attr1" had a 9 byte value for DUMP_DIR/smalll:
+some_text
+Attribute "attrname" had a 4 byte value for DUMP_DIR/sparsefile:
+1234
+Attribute "attr3" had a 10 byte value for DUMP_DIR/sub/smalll:
+some_text3
+Root names
+Attribute "attr2" had a 10 byte value for DUMP_DIR/biggg:
+some_text2
+Attribute "attr4" had a 10 byte value for DUMP_DIR/sub/biggg:
+some_text4
+Files 350.ea1 and 350.ea2 are identical
tests/xfs/group +1 -0
index 17fff27..efa025d 100644
@@ -179,3 +179,4 @@
 297 auto freeze
 298 auto attr symlink quick
 299 auto quota
+350 auto dump
Quoted 5 lines

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v4 2/2
#13 lore raw

Re: [PATCH V4 2/2] xfstests: xfsdump/restore test for partial_reg: Out of records. Extend attrs applied early

In reply to [email protected]
Quoted 8 lines · On 10/21/13 3:02 PM, [email protected] wrote:

Multi-stream xfsdump/xfsrestore of more than partialmax wholly-sparse files segfaults with the following warning:

"partial_reg: Out of records. Extend attrs applied early."

Add a test that dumps and restores partialmax + 1 wholly-sparse files.

Quoted 96 lines

---

tests/xfs/351 new file +68 -0
new file mode 100755
index 0000000..c0d8afb
@@ -0,0 +1,68 @@
+#! /bin/bash
+# FS QA Test No. 351
+#
+# Dump and restore partialmax + 1 wholly-sparse files
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 SGI.  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/filter
+. ./common/dump
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs xfs
+_supported_os Linux
+_require_scratch
+
+rm -f $seqres.full
+
+echo "Silence is golden."
+_wipe_fs
+mkdir $dump_dir >> $seqres.full 2>&1 || _fail "mkdir \"$dump_dir\" failed"
+for i in `seq 1 4`; do
+	$XFS_IO_PROG -f -c "truncate 1t" $dump_dir/sparsefile$i \
+		>> $seqres.full 2>&1 || _fail "failed to create sparsefile\"$i\""
+done
+# Dump and restore the files
+_prepare_restore_dir
+$XFSDUMP_PROG -L session -M label1 -M label2 -f $tmp.stream1 \
+	-f $tmp.stream2 $SCRATCH_MNT -s $dump_sdir \
+	>> $seqres.full 2>&1 || _fail "dump failed"
+$XFSRESTORE_PROG -F -f $tmp.stream1 -f $tmp.stream2 $restore_dir \
+	>> $seqres.full 2>&1 || _fail "restore failed"
+status=0
+exit 
tests/xfs/351.out new file +2 -0
new file mode 100644
index 0000000..42cf52e
@@ -0,0 +1,2 @@
+QA output created by 351
+Silence is golden.
tests/xfs/group +1 -0
index 17fff27..53ea498 100644
@@ -179,3 +179,4 @@
 297 auto freeze
 298 auto attr symlink quick
 299 auto quota
+351 auto dump
Quoted 5 lines

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#11 lore raw

Re: [PATCH V4 1/2] xfstests XFS: verify extended attributes after multi-stream xfsdump/xfsrestore

In reply to [email protected]

This has been committed.

Thanks
--Rich

commit 71026bf1f90cb376919fcc55636a665d287f394f

Author: Rich Johnston <[email protected]>
Date:   Mon Oct 21 20:02:31 2013 +0000

xfstests XFS: verify extended attributes after multi-stream
xfsdump/xfsresto

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#14 lore raw

Re: [PATCH V4 2/2] xfstests: xfsdump/restore test for partial_reg: Out of records. Extend attrs applied early

In reply to [email protected]

This has been committed.

Thanks
--Rich

commit fe8a159300c9fe9fb2e81320068fe78eb106f846

Author: Rich Johnston <[email protected]>
Date:   Mon Oct 21 20:02:32 2013 +0000

xfstests: xfsdump/restore test for partial_reg: Out of records.
Extend attr

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs