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