[PATCH] xfs/007: Fix failure for old superblocks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The commit 13c2dcbe2716 (xfs/007: check correct quota inodes) fixed
testing for new superblocks but broken testing for old superblocks where
project quota inode is stored in place of group quota inode. Fix that
case as well.

Signed-off-by: Jan Kara <jack@xxxxxxx>
---
 tests/xfs/007 | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/tests/xfs/007 b/tests/xfs/007
index 01cc42101097..c203566076e7 100755
--- a/tests/xfs/007
+++ b/tests/xfs/007
@@ -52,6 +52,12 @@ rm -f $seqres.full
 
 _scratch_mkfs_xfs >/dev/null 2>&1
 
+get_ino()
+{
+	qino=$1
+	xfs_db -c "sb 0" -c "p" $SCRATCH_DEV | grep $qino | awk '{print $NF}'
+}
+
 do_test()
 {
 	qino_1=$1
@@ -61,10 +67,14 @@ do_test()
 	echo "*** umount"
 	umount $SCRATCH_MNT
 
-	QINO_1=`xfs_db -c "sb 0" -c "p" $SCRATCH_DEV | \
-			grep $qino_1 | awk '{print $NF}'`
-	QINO_2=`xfs_db -c "sb 0" -c "p" $SCRATCH_DEV | \
-			grep $qino_2 | awk '{print $NF}'`
+	QINO_1=`get_ino $qino_1`
+	QINO_2=`get_ino $qino_2`
+	# Fall back to group inode for project quotas
+	if [ $QINO_2 -eq 0 ]; then
+		if [ $qino_2 = "pquotino" ]; then
+			QINO_2=`get_ino gquotino`
+		fi
+	fi
 
 	echo "*** Usage before quotarm ***"
 	xfs_db -c "inode $QINO_1" -c "p core.nblocks" $SCRATCH_DEV
-- 
2.1.4

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs




[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux