From: Eric Sandeen <sandeen@sandeen.net>
To: rjohnston@sgi.com
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH] xfstests XFS: verify extended attributes after multi-stream xfsdump/xfsrestore
Date: Mon, 07 Oct 2013 15:32:50 -0500 [thread overview]
Message-ID: <52531A72.1060902@sandeen.net> (raw)
In-Reply-To: <20131007193912.256265551@sgi.com>
On 10/7/13 2:38 PM, rjohnston@sgi.com wrote:
> Verify extended attributes are not lost after multi-stream
> xfsdump/xfsrestore of wholly-sparse files. xfsrestore did not
> recognize that if the LAST header was reached with no restoredsz set,
> (i.e the LAST header is the only header), the following warning is
> displayed:
>
> "partial_reg: Out of records. Extend attrs applied early."
>
> and the extended attributes on the current and following restored
> files are lost.
and restore segfaults too, IIRC. ;)
So I'm trying to understand - are attrs not applied because xfs_restore
terminates, or is everything fine other than the attrs missing when
it completes successfully?
iows, I get this when it fails:
QA output created by 350
Silence is golden.
+ATTR for /mnt/scratch/restore/dumpsrc/sparse0 DOES NOT match
+./tests/xfs/350: line 80: 18231 Segmentation fault (core dumped) $XFSRESTORE_PROG -F -f $tmp.stream1 -f $tmp.stream2 $RESTOREDIR 2>&1 >> $seqres.full
+restore failed
+(see /mnt/test2/git/xfstests/results//xfs/350.full for details)
and never get to the point of seeing if attrs are missing.
Anyway, a few other things below for the record...
> Signed-off-by: Rich Johnston <rjohnston@sgi.com>
>
> ---
> tests/xfs/350 | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
> tests/xfs/350.out | 2
> tests/xfs/group | 1
> 3 files changed, 137 insertions(+)
>
> Index: b/tests/xfs/350
> ===================================================================
> --- /dev/null
> +++ b/tests/xfs/350
> @@ -0,0 +1,134 @@
> +#! /bin/bash
> +# FS QA Test No. 350
Big jump!
> +#
> +# Verify extended attributes are not lost after multi-stream
> +# xfsdump/xfsrestore of 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=0 # success is the default!
> +trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +. ./common/filter
> +. ./common/dump
> +
> +# real QA test starts here
> +_supported_fs xfs
> +_supported_os Linux
> +
> +_require_multi_stream
_require_scratch
_scratch_mkfs
_scratch_mount
> +
> +# dir where we'll restore
> +RESTOREDIR=$SCRATCH_MNT/restore
so you need _require_scratch & _scratch_mkfs before this...
> +
> +# subdir used for dump/restore
> +DUMPDIR=dumpsrc
> +
> +# test extended attributes
> +attr_name=testattr
> +attr_value=1234
> +
> +# setup for test
> +rm -rf $seqres.full
no need to recursively remove a file, but *shrug* :)
> +mkdir -p $RESTOREDIR
> +mkdir -p $SCRATCH_MNT/$DUMPDIR
> +
> +# cleanup for next dump/restore.
> +_clean_dirs()
> +{
> + rm -rf $SCRATCH_MNT/$DUMPDIR/*
> + rm -rf $RESTOREDIR/*
> + rm -f $tmp.stream?
> +}
> +
> +# set the extended attributes on the test files.
> +_set_attrs()
> +{
> + for fname in $(ls -dD $SCRATCH_MNT/$DUMPDIR/*); do
> + attr -Rs $attr_name -V $attr_value $fname \
> + 2>&1 >> $seqres.full || _fail "could not set ATTR for $fname"
> + done
Just out of curiosity, is the root (-R) namespace relevant to the problem?
> +}
> +
> +# perform a dump and restore.
> +_do_dump_restore()
> +{
> + $XFSDUMP_PROG -L session -M label1 -M label2 -f $tmp.stream1 \
> + -f $tmp.stream2 $SCRATCH_MNT -s $DUMPDIR \
> + 2>&1 >> $seqres.full || _fail "dump failed"
> + $XFSRESTORE_PROG -F -f $tmp.stream1 -f $tmp.stream2 $RESTOREDIR \
> + 2>&1 >> $seqres.full || _fail "restore failed"
> +}
> +
> +# verify the restored files extended attributes and
> +# echo the error (if any) so the test will continue
> +_verify_attrs()
> +{
> + for fname in $(ls -dD $RESTOREDIR/$DUMPDIR/*); do
> + attr -Rg $attr_name $fname 2>&1 | tee -a $seqres.full | \
> + grep $attr_value 2>&1 >> $seqres.full || \
> + echo "ATTR for $fname DOES NOT match"
> + done
> +}
> +
> +# create files for test 1, a large file so the sparse file
> +# is in the next stream.
> +_create_test1_files()
> +{
> +
> + dd if=/dev/zero of=$SCRATCH_MNT/$DUMPDIR/10MB bs=1MB \
> + count=10 2>&1 >> $seqres.full | _filter_dd
> + truncate --size=1t $SCRATCH_MNT/$DUMPDIR/sparse0 2>&1 \
> + >> $seqres.full
> +}
> +
> +# create 4 sparse files for test 2
> +_create_test2_files()
> +{
> + for i in `seq 1 4`; do
> + truncate --size=1t $SCRATCH_MNT/$DUMPDIR/sparse$i 2>&1 >> \
> + $seqres.full || _fail "failed to create sparse \"$i\""
> + done
> +}
> +echo "Silence is golden."
> +echo "Starting Test 1" >> $seqres.full
> +_clean_dirs
> +_create_test1_files
> +_set_attrs
> +_do_dump_restore
> +_verify_attrs
> +
> +echo "Starting Test 2" >> $seqres.full
> +_clean_dirs
> +_create_test2_files
> +_set_attrs
> +_do_dump_restore
> +_verify_attrs
> +
> +# success, all done
> +exit
> Index: b/tests/xfs/350.out
> ===================================================================
> --- /dev/null
> +++ b/tests/xfs/350.out
> @@ -0,0 +1,2 @@
> +QA output created by 350
> +Silence is golden.
> Index: b/tests/xfs/group
> ===================================================================
> --- a/tests/xfs/group
> +++ b/tests/xfs/group
> @@ -179,3 +179,4 @@
> 297 auto freeze
> 298 auto attr symlink quick
> 299 auto quota
> +350 dump auto
>
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2013-10-07 20:32 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-01 16:30 [PATCH] xfsrestore: fix multi stream support Rich Johnston
2013-10-01 20:47 ` Eric Sandeen
2013-10-01 21:39 ` Rich Johnston
2013-10-01 22:02 ` Rich Johnston
2013-10-02 3:57 ` Eric Sandeen
2013-10-02 4:17 ` Eric Sandeen
2013-10-02 4:26 ` Eric Sandeen
2013-10-02 18:41 ` Eric Sandeen
2013-10-02 20:03 ` Rich Johnston
2013-10-02 20:13 ` Eric Sandeen
2013-10-03 13:40 ` Rich Johnston
[not found] ` <20131003212114.493910914@sgi.com>
2013-10-03 22:11 ` [PATCH] xfsdump: handle large, wholly-sparse files Eric Sandeen
2013-10-03 23:11 ` [PATCH V2] " Rich Johnston
2013-10-03 23:16 ` Eric Sandeen
2013-10-07 19:38 ` [PATCH] xfstests XFS: verify extended attributes after multi-stream xfsdump/xfsrestore rjohnston
2013-10-07 20:32 ` Eric Sandeen [this message]
2013-10-07 20:54 ` Rich Johnston
2013-10-07 21:00 ` Eric Sandeen
2013-10-08 0:53 ` Dave Chinner
2013-10-08 0:57 ` Eric Sandeen
2013-10-08 0:58 ` Eric Sandeen
2013-10-08 14:21 ` Rich Johnston
2013-10-08 19:27 ` Dave Chinner
2013-10-08 19:57 ` Eric Sandeen
2013-10-08 1:08 ` Dave Chinner
2013-10-08 14:22 ` Rich Johnston
2013-10-08 14:43 ` [PATCH V2] xfstests XFS: verify extended attributes after multi-stream xfsdump/xfsrestore are not lost rjohnston
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=52531A72.1060902@sandeen.net \
--to=sandeen@sandeen.net \
--cc=rjohnston@sgi.com \
--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