Skip to contentSkip to conversation

xfstests: _test_generic_punch: Obtain block size from $TEST_DIR

PATCH In review chandan 3 participants 3 messages Aug 28, 2013 – Aug 29, 2013

lore
Share & tools
lore

chandan

author
#0 lore raw

PATCH 1/1 xfstests: _test_generic_punch: Obtain block size from $TEST_DIR

The current code incorrectly gets block size information from $TEST_DEV instead of from $TEST_DIR. This returns the block size of the filesystem hosting the device file rather than that of the filesystem on $TEST_DEV.

---
 common/punch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/punch +1 -1
index 7b3c009..a49638c 100644
@@ -520,7 +520,7 @@ _test_generic_punch()
 	if [ "$remove_testfile" ]; then
 		rm -f $testfile
 	fi
-	block_size=`stat -f $TEST_DEV | grep "Block size" | cut -d " " -f3`
+	block_size=`stat -f $TEST_DIR | grep "Block size" | cut -d " " -f3`
 	$XFS_IO_PROG -f -c "truncate $block_size" \
 		-c "pwrite 0 $block_size" $sync_cmd \
 		-c "$zero_cmd 128 128" \
Signature · 7 lines
1.8.3.1


_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · chandan

The current code incorrectly gets block size information from $TEST_DEV instead of from $TEST_DIR. This returns the block size of the filesystem hosting the device file rather than that of the filesystem on $TEST_DEV.

Oof, yes, this looks right. Seems strange, I thought < 4k was working on x86; maybe just by accident.

I'll take another look at your other patch in light of this fix.

Thanks!

-Eric

Quoted 10 lines
---
 common/punch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/punch +0 -0
index 7b3c009..a49638c 100644

common/punch _test_generic_punch() · line 526

Quoted 8 lines
common/punch +1 -1
@@ -520,7 +520,7 @@ _test_generic_punch()
 	if [ "$remove_testfile" ]; then
 		rm -f $testfile
 	fi
-	block_size=`stat -f $TEST_DEV | grep "Block size" | cut -d " " -f3`
+	block_size=`stat -f $TEST_DIR | grep "Block size" | cut -d " " -f3`
 	$XFS_IO_PROG -f -c "truncate $block_size" \
 		-c "pwrite 0 $block_size" $sync_cmd \
 		-c "$zero_cmd 128 128" \

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