xfs
[Top] [All Lists]

[PATCH 5/6] xfs/217: prevent enospc failures on small test devices

To: xfs@xxxxxxxxxxx
Subject: [PATCH 5/6] xfs/217: prevent enospc failures on small test devices
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Mon, 24 Feb 2014 14:06:14 +1100
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1393211175-30016-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1393211175-30016-1-git-send-email-david@xxxxxxxxxxxxx>
From: Dave Chinner <dchinner@xxxxxxxxxx>

I'm running xfstests against a ramdisk, so I'm limited in size of
the test and scratch devices. While there are large enough to hold a
filesystem image with a 2GB log, the way the log changes position in
an image file as the size of the filesystem increases means that the
aggregated disk space of xfs/217 is more than enough to run a 4GB
TEST_DEV out of space and hence fail the test.

To avoid this problem, punch out the image file between every mkfs
iteration so that it only consumes the space needed by each
individual mkfs tests, not an aggregation of them all.

Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
---
 tests/xfs/217 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/xfs/217 b/tests/xfs/217
index 6c439c0..ab55a30 100755
--- a/tests/xfs/217
+++ b/tests/xfs/217
@@ -63,6 +63,10 @@ _do_mkfs()
                mount -o loop -t xfs $LOOP_DEV $LOOP_MNT
                echo "test write" > $LOOP_MNT/test
                umount -d $LOOP_MNT > /dev/null 2>&1
+
+               # punch out the previous blocks so that we keep the amount of
+               # disk space the test requires down to a minimum.
+               $XFS_IO_PROG -f -c "unresvsp 0 16383g" $LOOP_DEV
        done
 }
 # make large holey file
-- 
1.8.4.rc3

<Prev in Thread] Current Thread [Next in Thread>