xfs
[Top] [All Lists]

Re: [PATCH 04/10] xfstests: use preallocation for ag-wiper

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 04/10] xfstests: use preallocation for ag-wiper
From: Rich Johnston <rjohnston@xxxxxxx>
Date: Tue, 28 Aug 2012 09:02:08 -0500
Cc: <xfs@xxxxxxxxxxx>
In-reply-to: <1343291989-14987-5-git-send-email-david@xxxxxxxxxxxxx>
References: <1343291989-14987-1-git-send-email-david@xxxxxxxxxxxxx> <1343291989-14987-5-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120615 Thunderbird/13.0.1
On 07/26/2012 03:39 AM, Dave Chinner wrote:
From: Dave Chinner <dchinner@xxxxxxxxxx>

To enable sane testing of large scale filesystems, the --large-fs
test option uses xfs_db magic to mark AGs full without doing any IO.
This leaves only a small amount of free space left in the filesystem
to stress the high AGs of the filesystem rather than the low AGs.

This method requires us to have special filesystem check options to
avoid free space checking in xfs_check, and we cannot current run
xfs_repair on such a filesystem at all. As it is, free space
checking on xfs_check does not scale, so we still need to avoid this
checking regardless of how we fill the filesystem.

We can acheive exactly the same fill behaviour by preallocating a
single large file in the filesystem immediately after creating it.
This is a filesystem independent manner of filling the filesystem,
and allows us to do large filesystem testing on more than just XFS.

Further, this preallocation method effectively adds a new "very
large file" test. It also enables us to run an unmodified xfs_repair
or filesystem specific fsck program to check the filesystem for
sanity, so we can now do full sanity checking of such large
filesystems.

Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
---
  common.rc |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++++-----
  1 file changed, 53 insertions(+), 5 deletions(-)

diff --git a/common.rc b/common.rc
index b0af482..7bb1133 100644
--- a/common.rc
+++ b/common.rc
@@ -276,6 +276,47 @@ _scratch_mkfs_options()
     echo $SCRATCH_OPTIONS $MKFS_OPTIONS $* $SCRATCH_DEV
 }

+
+_setup_large_xfs_fs()
+{
+       fs_size=$1
+       local tmp_dir=/tmp/
+
+       [ "$LARGE_SCRATCH_DEV" != yes ] && return 0
+       [ -z "$SCRATCH_DEV_EMPTY_SPACE" ] && SCRATCH_DEV_EMPTY_SPACE=0
+       [ $SCRATCH_DEV_EMPTY_SPACE -ge $fs_size ] && return 0
+
+       # calculate the size of the file we need to allocate.
+       # Default free space in the FS is 50GB, but you can specify more via
+       # SCRATCH_DEV_EMPTY_SPACE
+       file_size=$(($fs_size - 50*1024*1024*1024))
+       file_size=$(($file_size - $SCRATCH_DEV_EMPTY_SPACE))
+
+       # mount the filesystem, create the file, unmount it
+       _scratch_mount 2>&1 >$tmp_dir/mnt.err
+       local status=$?
+       if [ $status -ne 0 ]; then
+               echo "mount failed"
+               cat $tmp_dir/mnt.err >&2
+               rm -f $tmp_dir/mnt.err
+               return $status
+       fi
+       rm -f $tmp_dir/mnt.err
+
+       xfs_io -F -f \
+               -c "truncate $file_size" \
+               -c "falloc -k 0 $file_size" \
+               $SCRATCH_MNT/.use_space 2>&1 > /dev/null

Looks like patch 10 (exclude largefs fill files from dump tests) does not ignore this file as it should when using xfsdump -e and chattr +d. The following tests which are all in the auto group fail when using the --large-fs option:
        019 026-028 046 047 050 056 059 060 062-066

I have attached the specific error output.

Regards
--Rich



Attachment: patch10.err
Description: Text document

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