XFS TESTS: Add ENOSPC Hole Punch Test
PATCH v5 3/3 XFS TESTS: Add ENOSPC Hole Punch Test
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 +12 -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 · 1 line
1.7.1
This one fails for me because my test system doesn't have sudo installed. I can't see any reason why a simple su wouldn't be enough.
We already have a helper to make su usable on both IRIX and Linux in test 123, and it might be a good idea to add this to the common routines and use it.
I'd also suggest to split this test off 252 into a new test case, as unlike the other tests it actually requires a scratch devices, and in general is pretty different from the simple xfs_io exercises in 252.
I'd also move the newly added helpers directly into the new testcase as they really aren't common.
Quoted 7 lines · Christoph Hellwig
This one fails for me because my test system doesn't have sudo installed. I can't see any reason why a simple su wouldn't be enough.
We already have a helper to make su usable on both IRIX and Linux in test 123, and it might be a good idea to add this to the common routines and use it.
Quoted 7 lines
I'd also suggest to split this test off 252 into a new test case, as unlike the other tests it actually requires a scratch devices, and in general is pretty different from the simple
xfs_ioexercises in 252.I'd also move the newly added helpers directly into the new testcase as they really aren't common.
Hi Christoph,
Thanks for the review, I will make those adjustments then and submit them in a separate patch set since it sounds like 1/3 and 2/3 are moving forward. Thanks again! :)
Allison Henderson