Skip to contentSkip to conversation

xfsqa - 166 - fix filter for stripe aligned filesystems

PATCH In review David Chinner 3 participants 3 messages Apr 11, 2008 – Apr 14, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfsqa - 166 - fix filter for stripe aligned filesystems

Flags has extra bits set in it xfs_bmap output when the filesyste is using stripe alignment. Fix the test to only look at the unwritten flag. Capture the xfs_bmap output as well so failures can be debugged easily.

---
 xfstests/166 |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
xfstests/166 +10 -7
Index: xfs-cmds/xfstests/166
===================================================================
@@ -17,6 +17,7 @@ here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
 trap "_cleanup; exit \$status" 0 1 2 3 15
+rm $seq.full
 
 _cleanup()
 {
@@ -39,9 +40,14 @@ _filter_blocks()
 		unwritten2 = ((1048576/512) / 2) - 2 * written_size
 	}
 
-	if ($7) {
-		size = "RIGHT"
-		flags = "GOOD"
+	/* is the extent unwritten? */
+	unwritten_ext = 0;
+	if ($7 >= 10000)
+		unwritten_ext = 1;
+
+	size = "RIGHT"
+	flags = "GOOD"
+	if (unwritten_ext) {
 		if (unwritten1) {
 			if ($6 != unwritten1)
 				size = "WRONG"
@@ -49,11 +55,7 @@ _filter_blocks()
 		} else if ($6 != unwritten2) {
 			size = "WRONG"
 		}
-		if ($7 < 10000)
-			flags = "BAD"
 	} else {
-		size = "RIGHT"
-		flags = "GOOD"
 		if ($6 != written_size)
 			size = "WRONG"
 	}
@@ -77,6 +79,7 @@ FILE_SIZE=1048576
 rm -f $TEST_FILE
 $TEST_PROG $FILE_SIZE $TEST_FILE
 
+xfs_bmap -vp $TEST_FILE >> $seq.full
 xfs_bmap -vp $TEST_FILE | _filter_blocks
 
 status=0
#1 lore raw

Looks good, one minor comment.

Quoted 15 lines · David Chinner

Flags has extra bits set in it xfs_bmap output when the filesyste is using stripe alignment. Fix the test to only look at the unwritten flag. Capture the xfs_bmap output as well so failures can be debugged easily.

---
 xfstests/166 |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

Index: xfs-cmds/xfstests/166
===================================================================

xfstests/166 here=`pwd` · line 20

Quoted 4 lines
xfstests/166 +1 -0
@@ -17,6 +17,7 @@ here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
 trap "_cleanup; exit \$status" 0 1 2 3 15
+rm $seq.full

rm -f ? so that it doesn't complain when file is not there ?

Quoted 40 lines
xfstests/166 +9 -7
 _cleanup()
 {
@@ -39,9 +40,14 @@ _filter_blocks()
 		unwritten2 = ((1048576/512) / 2) - 2 * written_size
 	}
 
-	if ($7) {
-		size = "RIGHT"
-		flags = "GOOD"
+	/* is the extent unwritten? */
+	unwritten_ext = 0;
+	if ($7 >= 10000)
+		unwritten_ext = 1;
+
+	size = "RIGHT"
+	flags = "GOOD"
+	if (unwritten_ext) {
 		if (unwritten1) {
 			if ($6 != unwritten1)
 				size = "WRONG"
@@ -49,11 +55,7 @@ _filter_blocks()
 		} else if ($6 != unwritten2) {
 			size = "WRONG"
 		}
-		if ($7 < 10000)
-			flags = "BAD"
 	} else {
-		size = "RIGHT"
-		flags = "GOOD"
 		if ($6 != written_size)
 			size = "WRONG"
 	}
@@ -77,6 +79,7 @@ FILE_SIZE=1048576
 rm -f $TEST_FILE
 $TEST_PROG $FILE_SIZE $TEST_FILE
 
+xfs_bmap -vp $TEST_FILE >> $seq.full
 xfs_bmap -vp $TEST_FILE | _filter_blocks
 
 status=0
Signature · 1 line
Niv Sardi
#2 lore raw
Quoted 14 lines · Niv Sardi

Looks good, one minor comment.

Quoted 10 lines · David Chinner

Flags has extra bits set in it xfs_bmap output when the filesyste is using stripe alignment. Fix the test to only look at the unwritten flag. Capture the xfs_bmap output as well so failures can be debugged easily.

---
 xfstests/166 |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
Quoted 11 lines

xfstests/166 here=`pwd` · line 20

Quoted 9 lines

Index: xfs-cmds/xfstests/166
===================================================================

xfstests/166 +1 -0
@@ -17,6 +17,7 @@ here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
 trap "_cleanup; exit \$status" 0 1 2 3 15
+rm $seq.full

rm -f ? so that it doesn't complain when file is not there ?

All other tests do use rm -f here, it seems.

-Eric