Skip to contentSkip to conversation

xfstests: add test 203, xfs_io bmap reallocation

PATCH In review Christoph Hellwig 2 participants 4 messages Mar 20, 2009 – Mar 21, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests: add test 203, xfs_io bmap reallocation

Test that we can get all extent/hole information for files with more than 16 extents and 15 holes which require a reallocation based on XFS_IOC_FSGETXATTR.

Based on a testcase from Tomasz Majkowski <[email protected]>.

203 new file +71 -0
Index: xfstests-dev/203
===================================================================
@@ -0,0 +1,71 @@
+#! /bin/sh
+# FS QA Test No. 203
+#
+# Test out reallocation of the extent array in xfs_io.
+# Based on a testcase from Tomasz Majkowski <[email protected]>.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2009 Christoph Hellwig.
+#-----------------------------------------------------------------------
+#
+# creator
[email protected]
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+
+_write_holes()
+{
+	file=$1
+	holes=$2
+	let writes=$holes+1
+
+	offset=0
+	for i in `seq 0 $writes`; do
+		xfs_io -f $file -c "pwrite -q $offset 1"
+		let offset=$offset+0x100000
+	done
+}
+
+#       0: [0..7]: 104..111
+#       1: [8..2047]: hole
+_filter_bmap()
+{
+	awk '$3 ~ /hole/ { print $1, $2, $3; next }
+             {print $1, $2; next}'
+}
+
+_cleanup()
+{
+	rm -f $TEST_DIR/hole_file*
+	rm -f $TEST_DIR/r??
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# real QA test starts here
+_supported_fs xfs
+_supported_os Linux
+
+
+for i in 10 14 15 16 17 28 29 30 31; do
+        rm -f $TEST_DIR/hole_file
+	_write_holes $TEST_DIR/hole_file${i} ${i}
+done
+
+for i in 10 14 15 16 17 28 29 30 31; do
+        xfs_bmap $TEST_DIR/hole_file${i} | _filter_bmap
+	echo
+done
+
+# success, all done
+echo "*** done"
+rm -f $seq.full
+status=0
203.out new file +427 -0

427 lines not on this page · raw message

group +1 -0
Index: xfstests-dev/group
===================================================================
@@ -307,3 +307,4 @@
 200 mount auto quick
 201 metadata auto quick
 202 repair auto quick
+203 ioctl auto

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

#1 lore raw
Quoted 8 lines · Christoph Hellwig

Test that we can get all extent/hole information for files with more than 16 extents and 15 holes which require a reallocation based on XFS_IOC_FSGETXATTR.

Based on a testcase from Tomasz Majkowski <[email protected]>.

Looks fine to me (do we need a GPL header on the c file? license on all of xfsqa is hard to sort out, I guess...)

-Eric

Quoted 518 lines

Index: xfstests-dev/203
===================================================================

203 new file +71 -0
@@ -0,0 +1,71 @@
+#! /bin/sh
+# FS QA Test No. 203
+#
+# Test out reallocation of the extent array in xfs_io.
+# Based on a testcase from Tomasz Majkowski <[email protected]>.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2009 Christoph Hellwig.
+#-----------------------------------------------------------------------
+#
+# creator
[email protected]
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+
+_write_holes()
+{
+	file=$1
+	holes=$2
+	let writes=$holes+1
+
+	offset=0
+	for i in `seq 0 $writes`; do
+		xfs_io -f $file -c "pwrite -q $offset 1"
+		let offset=$offset+0x100000
+	done
+}
+
+#       0: [0..7]: 104..111
+#       1: [8..2047]: hole
+_filter_bmap()
+{
+	awk '$3 ~ /hole/ { print $1, $2, $3; next }
+             {print $1, $2; next}'
+}
+
+_cleanup()
+{
+	rm -f $TEST_DIR/hole_file*
+	rm -f $TEST_DIR/r??
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# real QA test starts here
+_supported_fs xfs
+_supported_os Linux
+
+
+for i in 10 14 15 16 17 28 29 30 31; do
+        rm -f $TEST_DIR/hole_file
+	_write_holes $TEST_DIR/hole_file${i} ${i}
+done
+
+for i in 10 14 15 16 17 28 29 30 31; do
+        xfs_bmap $TEST_DIR/hole_file${i} | _filter_bmap
+	echo
+done
+
+# success, all done
+echo "*** done"
+rm -f $seq.full
+status=0

Index: xfstests-dev/203.out
===================================================================

203.out new file +427 -0
@@ -0,0 +1,427 @@
+QA output created by 203
+/mnt/test/hole_file10: 
+0: [0..7]:
+1: [8..2047]: hole
+2: [2048..2055]:
+3: [2056..4095]: hole
+4: [4096..4103]:
+5: [4104..6143]: hole
+6: [6144..6151]:
+7: [6152..8191]: hole
+8: [8192..8199]:
+9: [8200..10239]: hole
+10: [10240..10247]:
+11: [10248..12287]: hole
+12: [12288..12295]:
+13: [12296..14335]: hole
+14: [14336..14343]:
+15: [14344..16383]: hole
+16: [16384..16391]:
+17: [16392..18431]: hole
+18: [18432..18439]:
+19: [18440..20479]: hole
+20: [20480..20487]:
+21: [20488..22527]: hole
+22: [22528..22535]:
+
+/mnt/test/hole_file14: 
+0: [0..7]:
+1: [8..2047]: hole
+2: [2048..2055]:
+3: [2056..4095]: hole
+4: [4096..4103]:
+5: [4104..6143]: hole
+6: [6144..6151]:
+7: [6152..8191]: hole
+8: [8192..8199]:
+9: [8200..10239]: hole
+10: [10240..10247]:
+11: [10248..12287]: hole
+12: [12288..12295]:
+13: [12296..14335]: hole
+14: [14336..14343]:
+15: [14344..16383]: hole
+16: [16384..16391]:
+17: [16392..18431]: hole
+18: [18432..18439]:
+19: [18440..20479]: hole
+20: [20480..20487]:
+21: [20488..22527]: hole
+22: [22528..22535]:
+23: [22536..24575]: hole
+24: [24576..24583]:
+25: [24584..26623]: hole
+26: [26624..26631]:
+27: [26632..28671]: hole
+28: [28672..28679]:
+29: [28680..30719]: hole
+30: [30720..30727]:
+
+/mnt/test/hole_file15: 
+0: [0..7]:
+1: [8..2047]: hole
+2: [2048..2055]:
+3: [2056..4095]: hole
+4: [4096..4103]:
+5: [4104..6143]: hole
+6: [6144..6151]:
+7: [6152..8191]: hole
+8: [8192..8199]:
+9: [8200..10239]: hole
+10: [10240..10247]:
+11: [10248..12287]: hole
+12: [12288..12295]:
+13: [12296..14335]: hole
+14: [14336..14343]:
+15: [14344..16383]: hole
+16: [16384..16391]:
+17: [16392..18431]: hole
+18: [18432..18439]:
+19: [18440..20479]: hole
+20: [20480..20487]:
+21: [20488..22527]: hole
+22: [22528..22535]:
+23: [22536..24575]: hole
+24: [24576..24583]:
+25: [24584..26623]: hole
+26: [26624..26631]:
+27: [26632..28671]: hole
+28: [28672..28679]:
+29: [28680..30719]: hole
+30: [30720..30727]:
+31: [30728..32767]: hole
+32: [32768..32775]:
+
+/mnt/test/hole_file16: 
+0: [0..7]:
+1: [8..2047]: hole
+2: [2048..2055]:
+3: [2056..4095]: hole
+4: [4096..4103]:
+5: [4104..6143]: hole
+6: [6144..6151]:
+7: [6152..8191]: hole
+8: [8192..8199]:
+9: [8200..10239]: hole
+10: [10240..10247]:
+11: [10248..12287]: hole
+12: [12288..12295]:
+13: [12296..14335]: hole
+14: [14336..14343]:
+15: [14344..16383]: hole
+16: [16384..16391]:
+17: [16392..18431]: hole
+18: [18432..18439]:
+19: [18440..20479]: hole
+20: [20480..20487]:
+21: [20488..22527]: hole
+22: [22528..22535]:
+23: [22536..24575]: hole
+24: [24576..24583]:
+25: [24584..26623]: hole
+26: [26624..26631]:
+27: [26632..28671]: hole
+28: [28672..28679]:
+29: [28680..30719]: hole
+30: [30720..30727]:
+31: [30728..32767]: hole
+32: [32768..32775]:
+33: [32776..34815]: hole
+34: [34816..34823]:
+
+/mnt/test/hole_file17: 
+0: [0..7]:
+1: [8..2047]: hole
+2: [2048..2055]:
+3: [2056..4095]: hole
+4: [4096..4103]:
+5: [4104..6143]: hole
+6: [6144..6151]:
+7: [6152..8191]: hole
+8: [8192..8199]:
+9: [8200..10239]: hole
+10: [10240..10247]:
+11: [10248..12287]: hole
+12: [12288..12295]:
+13: [12296..14335]: hole
+14: [14336..14343]:
+15: [14344..16383]: hole
+16: [16384..16391]:
+17: [16392..18431]: hole
+18: [18432..18439]:
+19: [18440..20479]: hole
+20: [20480..20487]:
+21: [20488..22527]: hole
+22: [22528..22535]:
+23: [22536..24575]: hole
+24: [24576..24583]:
+25: [24584..26623]: hole
+26: [26624..26631]:
+27: [26632..28671]: hole
+28: [28672..28679]:
+29: [28680..30719]: hole
+30: [30720..30727]:
+31: [30728..32767]: hole
+32: [32768..32775]:
+33: [32776..34815]: hole
+34: [34816..34823]:
+35: [34824..36863]: hole
+36: [36864..36871]:
+
+/mnt/test/hole_file28: 
+0: [0..7]:
+1: [8..2047]: hole
+2: [2048..2055]:
+3: [2056..4095]: hole
+4: [4096..4103]:
+5: [4104..6143]: hole
+6: [6144..6151]:
+7: [6152..8191]: hole
+8: [8192..8199]:
+9: [8200..10239]: hole
+10: [10240..10247]:
+11: [10248..12287]: hole
+12: [12288..12295]:
+13: [12296..14335]: hole
+14: [14336..14343]:
+15: [14344..16383]: hole
+16: [16384..16391]:
+17: [16392..18431]: hole
+18: [18432..18439]:
+19: [18440..20479]: hole
+20: [20480..20487]:
+21: [20488..22527]: hole
+22: [22528..22535]:
+23: [22536..24575]: hole
+24: [24576..24583]:
+25: [24584..26623]: hole
+26: [26624..26631]:
+27: [26632..28671]: hole
+28: [28672..28679]:
+29: [28680..30719]: hole
+30: [30720..30727]:
+31: [30728..32767]: hole
+32: [32768..32775]:
+33: [32776..34815]: hole
+34: [34816..34823]:
+35: [34824..36863]: hole
+36: [36864..36871]:
+37: [36872..38911]: hole
+38: [38912..38919]:
+39: [38920..40959]: hole
+40: [40960..40967]:
+41: [40968..43007]: hole
+42: [43008..43015]:
+43: [43016..45055]: hole
+44: [45056..45063]:
+45: [45064..47103]: hole
+46: [47104..47111]:
+47: [47112..49151]: hole
+48: [49152..49159]:
+49: [49160..51199]: hole
+50: [51200..51207]:
+51: [51208..53247]: hole
+52: [53248..53255]:
+53: [53256..55295]: hole
+54: [55296..55303]:
+55: [55304..57343]: hole
+56: [57344..57351]:
+57: [57352..59391]: hole
+58: [59392..59399]:
+
+/mnt/test/hole_file29: 
+0: [0..7]:
+1: [8..2047]: hole
+2: [2048..2055]:
+3: [2056..4095]: hole
+4: [4096..4103]:
+5: [4104..6143]: hole
+6: [6144..6151]:
+7: [6152..8191]: hole
+8: [8192..8199]:
+9: [8200..10239]: hole
+10: [10240..10247]:
+11: [10248..12287]: hole
+12: [12288..12295]:
+13: [12296..14335]: hole
+14: [14336..14343]:
+15: [14344..16383]: hole
+16: [16384..16391]:
+17: [16392..18431]: hole
+18: [18432..18439]:
+19: [18440..20479]: hole
+20: [20480..20487]:
+21: [20488..22527]: hole
+22: [22528..22535]:
+23: [22536..24575]: hole
+24: [24576..24583]:
+25: [24584..26623]: hole
+26: [26624..26631]:
+27: [26632..28671]: hole
+28: [28672..28679]:
+29: [28680..30719]: hole
+30: [30720..30727]:
+31: [30728..32767]: hole
+32: [32768..32775]:
+33: [32776..34815]: hole
+34: [34816..34823]:
+35: [34824..36863]: hole
+36: [36864..36871]:
+37: [36872..38911]: hole
+38: [38912..38919]:
+39: [38920..40959]: hole
+40: [40960..40967]:
+41: [40968..43007]: hole
+42: [43008..43015]:
+43: [43016..45055]: hole
+44: [45056..45063]:
+45: [45064..47103]: hole
+46: [47104..47111]:
+47: [47112..49151]: hole
+48: [49152..49159]:
+49: [49160..51199]: hole
+50: [51200..51207]:
+51: [51208..53247]: hole
+52: [53248..53255]:
+53: [53256..55295]: hole
+54: [55296..55303]:
+55: [55304..57343]: hole
+56: [57344..57351]:
+57: [57352..59391]: hole
+58: [59392..59399]:
+59: [59400..61439]: hole
+60: [61440..61447]:
+
+/mnt/test/hole_file30: 
+0: [0..7]:
+1: [8..2047]: hole
+2: [2048..2055]:
+3: [2056..4095]: hole
+4: [4096..4103]:
+5: [4104..6143]: hole
+6: [6144..6151]:
+7: [6152..8191]: hole
+8: [8192..8199]:
+9: [8200..10239]: hole
+10: [10240..10247]:
+11: [10248..12287]: hole
+12: [12288..12295]:
+13: [12296..14335]: hole
+14: [14336..14343]:
+15: [14344..16383]: hole
+16: [16384..16391]:
+17: [16392..18431]: hole
+18: [18432..18439]:
+19: [18440..20479]: hole
+20: [20480..20487]:
+21: [20488..22527]: hole
+22: [22528..22535]:
+23: [22536..24575]: hole
+24: [24576..24583]:
+25: [24584..26623]: hole
+26: [26624..26631]:
+27: [26632..28671]: hole
+28: [28672..28679]:
+29: [28680..30719]: hole
+30: [30720..30727]:
+31: [30728..32767]: hole
+32: [32768..32775]:
+33: [32776..34815]: hole
+34: [34816..34823]:
+35: [34824..36863]: hole
+36: [36864..36871]:
+37: [36872..38911]: hole
+38: [38912..38919]:
+39: [38920..40959]: hole
+40: [40960..40967]:
+41: [40968..43007]: hole
+42: [43008..43015]:
+43: [43016..45055]: hole
+44: [45056..45063]:
+45: [45064..47103]: hole
+46: [47104..47111]:
+47: [47112..49151]: hole
+48: [49152..49159]:
+49: [49160..51199]: hole
+50: [51200..51207]:
+51: [51208..53247]: hole
+52: [53248..53255]:
+53: [53256..55295]: hole
+54: [55296..55303]:
+55: [55304..57343]: hole
+56: [57344..57351]:
+57: [57352..59391]: hole
+58: [59392..59399]:
+59: [59400..61439]: hole
+60: [61440..61447]:
+61: [61448..63487]: hole
+62: [63488..63495]:
+
+/mnt/test/hole_file31: 
+0: [0..7]:
+1: [8..2047]: hole
+2: [2048..2055]:
+3: [2056..4095]: hole
+4: [4096..4103]:
+5: [4104..6143]: hole
+6: [6144..6151]:
+7: [6152..8191]: hole
+8: [8192..8199]:
+9: [8200..10239]: hole
+10: [10240..10247]:
+11: [10248..12287]: hole
+12: [12288..12295]:
+13: [12296..14335]: hole
+14: [14336..14343]:
+15: [14344..16383]: hole
+16: [16384..16391]:
+17: [16392..18431]: hole
+18: [18432..18439]:
+19: [18440..20479]: hole
+20: [20480..20487]:
+21: [20488..22527]: hole
+22: [22528..22535]:
+23: [22536..24575]: hole
+24: [24576..24583]:
+25: [24584..26623]: hole
+26: [26624..26631]:
+27: [26632..28671]: hole
+28: [28672..28679]:
+29: [28680..30719]: hole
+30: [30720..30727]:
+31: [30728..32767]: hole
+32: [32768..32775]:
+33: [32776..34815]: hole
+34: [34816..34823]:
+35: [34824..36863]: hole
+36: [36864..36871]:
+37: [36872..38911]: hole
+38: [38912..38919]:
+39: [38920..40959]: hole
+40: [40960..40967]:
+41: [40968..43007]: hole
+42: [43008..43015]:
+43: [43016..45055]: hole
+44: [45056..45063]:
+45: [45064..47103]: hole
+46: [47104..47111]:
+47: [47112..49151]: hole
+48: [49152..49159]:
+49: [49160..51199]: hole
+50: [51200..51207]:
+51: [51208..53247]: hole
+52: [53248..53255]:
+53: [53256..55295]: hole
+54: [55296..55303]:
+55: [55304..57343]: hole
+56: [57344..57351]:
+57: [57352..59391]: hole
+58: [59392..59399]:
+59: [59400..61439]: hole
+60: [61440..61447]:
+61: [61448..63487]: hole
+62: [63488..63495]:
+63: [63496..65535]: hole
+64: [65536..65543]:
+
+*** done

Index: xfstests-dev/group
===================================================================

group +1 -0
@@ -307,3 +307,4 @@
 200 mount auto quick
 201 metadata auto quick
 202 repair auto quick
+203 ioctl auto
Quoted 5 lines

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

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

#2 lore raw
Quoted 5 lines · Eric Sandeen
Quoted 4 lines · Christoph Hellwig

Test that we can get all extent/hole information for files with more than 16 extents and 15 holes which require a reallocation based on XFS_IOC_FSGETXATTR.

Quoted 7 lines
Quoted 4 lines

Based on a testcase from Tomasz Majkowski <[email protected]>.

Looks fine to me (do we need a GPL header on the c file? license on all of xfsqa is hard to sort out, I guess...)

There's no c file.

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

#3 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 5 lines · Eric Sandeen
Quoted 4 lines · Christoph Hellwig

Test that we can get all extent/hole information for files with more than 16 extents and 15 holes which require a reallocation based on XFS_IOC_FSGETXATTR.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Based on a testcase from Tomasz Majkowski <[email protected]>.

Looks fine to me (do we need a GPL header on the c file? license on all of xfsqa is hard to sort out, I guess...)

There's no c file.

Oh, heh. I had Tomasz's original testcase in mind, sorry! :)

-Eric

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