Skip to contentSkip to conversation

xfs/007: Fix failure for old superblocks

PATCH New Jan Kara 1 participant 1 message Mar 17, 2015

lore
Share & tools
lore

Jan Kara

author
#0 lore raw

PATCH 1/1 xfs/007: Fix failure for old superblocks

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.

---
 tests/xfs/007 | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
tests/xfs/007 +14 -4
index 01cc42101097..c203566076e7 100755
@@ -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
Signature · 6 lines
2.1.4

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