Add ENOSPC Hole Punch Test
PATCH v4 3/3 Add ENOSPC Hole Punch Test
-------- Original Message --------
Subject: [XFSTEST Add Fallocate Punch Hole Tests 3/3 v4] Add ENOSPC Hole Punch Test
Date: Wed, 25 May 2011 19:34:44 -0700
From: Allison Henderson <[email protected]>
To: xfs-oss <[email protected]>
This patch adds a test to 252 that tests that a hole can be punched even when the disk is full. Reserved blocks should be used to allow a punch hole to proceed even when there is not enough blocks to further fragment the file. To test this, the file system is fragmented by punching holes in regular intervals and filling the file system between punches. This will eventually force the file system to use reserved blocks to proceed with the punch hole operation.
---
:100755 100755 5efa243... b5204fe... M 252
:100644 100644 ddf63b0... fc6123c... M common.punch
252 | 12 +++++++ common.punch | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+), 0 deletions(-)
252 +1 -0
@@ -49,6 +49,7 @@ _supported_os Linux _require_xfs_io_falloc_punch _require_xfs_io_fiemap +_require_scratch testfile=$TEST_DIR/252.$$
@@ -64,4 +65,15 @@ _test_generic_punch -k falloc fpunch fpunch fiemap _filter_fiemap $testfile -F # Delayed allocation multi punch hole tests _test_generic_punch -d -k falloc fpunch fpunch fiemap _filter_fiemap
$testfile -F
+# Test full filesystem hole punching.
+# Make a small file system to fill
+umount $SCRATCH_DEV &> /dev/null
+_scratch_mkfs_sized $(( 1024 * 1024 * 1024 )) &> /dev/null +_scratch_mount
+# Test must be able to write files with non-root permissions +chmod 777 $SCRATCH_MNT
+
+block_size=stat -f $SCRATCH_DEV | grep "Block size" | cut -d " " -f3 +_test_full_fs_punch $(( $block_size * 2 )) $block_size 500 $SCRATCH_MNT/252.$$ +
status=0 ; exit
common.punch +95 -0
100 lines not on this page · raw message
Signature · 7 lines
1.7.1 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs