xfs
[Top] [All Lists]

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

To: xfs@xxxxxxxxxxx
Subject: [PATCH] xfs/007: Fix failure for old superblocks
From: Jan Kara <jack@xxxxxxx>
Date: Tue, 17 Mar 2015 16:19:00 +0100
Cc: Jan Kara <jack@xxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] xfs/007: Fix failure for old superblocks, Jan Kara <=