All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs/007: Fix failure for old superblocks
@ 2015-03-17 15:19 Jan Kara
  0 siblings, 0 replies; only message in thread
From: Jan Kara @ 2015-03-17 15:19 UTC (permalink / raw)
  To: xfs; +Cc: Jan Kara

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@suse.cz>
---
 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@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-03-17 15:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-17 15:19 [PATCH] xfs/007: Fix failure for old superblocks Jan Kara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.