On Sun, 2012-08-26 at 22:27 -0500, Eric Sandeen wrote:<br>>Test that xfsdump/xfsrestore properly restores more than the<br>> bottom 16 bits of a 32-bit projid.<br>> <br>> Signed-off-by: Eric Sandeen <<a href="mailto:sandeen@sandeen.net">sandeen@sandeen.net</a>><br>
> ---<br>> <br>> diff --git a/285 b/285<br>> new file mode 100755<br>> index 0000000..2804e5d<br>> --- /dev/null<br>> +++ b/285<br>> @@ -0,0 +1,81 @@<br>> +#! /bin/bash<br>> +# FS QA Test No. 285<br>
> +#<br>> +# Test projid32: persist 32 bit projids thorugh dump/restore<br>> +#<br>> +#-----------------------------------------------------------------------<br>> +# Copyright (c) 2012 Eric Sandeen. All Rights Reserved.<br>
> +#<br>> +# This program is free software; you can redistribute it and/or<br>> +# modify it under the terms of the GNU General Public License as<br>> +# published by the Free Software Foundation.<br>> +#<br>
> +# This program is distributed in the hope that it would be useful,<br>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of<br>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>
> +# GNU General Public License for more details.<br>> +#<br>> +# You should have received a copy of the GNU General Public License<br>> +# along with this program; if not, write the Free Software Foundation,<br>
> +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA<br>> +#-----------------------------------------------------------------------<br>> +#<br>> +# creator<br>> +owner=<a href="mailto:sandeen@sandeen.net">sandeen@sandeen.net</a><br>
> +<br>> +seq=`basename $0`<br>> +echo "QA output created by $seq"<br>> +<br>> +here=`pwd`<br>> +tmp=/tmp/$$<br>> +status=1 # failure is the default!<br>> +trap "_cleanup; exit \$status" 0 1 2 3 15<br>
> +<br>> +_cleanup()<br>> +{<br>> + cd /<br>> + rm -f $tmp.*<br>> +}<br>> +<br>> +# get standard environment, filters and checks<br>> +. ./common.rc<br>> +. ./common.filter<br>> +. ./common.dump<br>
> +. ./common.quota<br>> +<br>> +_require_scratch<br>> +_require_xfs_quota<br>> +<br>> +# real QA test starts here<br>> +<br>> +_supported_fs xfs<br>> +_supported_os IRIX Linux<br>> +<br>> +_scratch_mkfs_xfs -i projid32bit=1 >> $seq.full || _fail "mkfs failed"<br>
> +<br>> +export MOUNT_OPTIONS="-opquota"<br>> +_qmount<br>> +_require_prjquota $SCRATCH_DEV<br>> +<br>> +# > 16 bit project ID<br>> +PROJID=2123456789<br>> +<br>> +# Put a project quota on a dir<br>
> +mkdir $SCRATCH_MNT/dir<br>> +xfs_quota -x -c "project -s -p $SCRATCH_MNT/dir $PROJID" $SCRATCH_MNT >> $seq.full || _fail "dir pquota failed"<br>> +<br>> +# Dump it then restore it to a fresh fs, and check the projid<br>
> +rm -f $tmp.dumpfile<br>> +xfsdump -L label -M media -f $tmp.dumpfile $SCRATCH_MNT >> $seq.full || _fail "dump failed"<br>> +umount $SCRATCH_DEV<br>> +<br>> +_scratch_mkfs_xfs -i projid32bit=1 >> $seq.full || _fail "re-mkfs failed"<br>
> +_qmount<br>> +xfsrestore -f $tmp.dumpfile $SCRATCH_MNT >> $seq.full || _fail "restore failed"<br>> +<br>> +# check (-c) that we got the correct project ID back post-restore<br>> +xfs_quota -x -c "project -s -c -p $SCRATCH_MNT/dir $PROJID" $SCRATCH_MNT<br>
> +<br>> +# success, all done<br>> +status=0<br>> +exit<br>> diff --git a/285.out b/285.out<br>> new file mode 100644<br>> index 0000000..daf4e4c<br>> --- /dev/null<br>> +++ b/285.out<br>> @@ -0,0 +1,3 @@<br>
> +QA output created by 285<br>> +Checking project 2123456790 (path /mnt/scratch/dir)...<br>> +Processed 1 (/etc/projects and cmdline) paths for project 2123456790 with recursion depth infinite (-1).<br>> diff --git a/group b/group<br>
> index 104ed35..bbc74fe 100644<br>> --- a/group<br>> +++ b/group<br>> @@ -403,3 +403,4 @@ deprecated<br>> 282 dump ioctl auto quick<br>> 283 dump ioctl auto quick<br>> 284 auto<br>> +285 auto dump quota<br>
> <br>> <br><br>I've been working on a xfstests projid32bit test case, too. It covers this area + few others. I'll post that one, soon.<br>