xfs
[Top] [All Lists]

[PATCH] xfstest: preallocate file space greater then MAXEXTLEN

To: xfs@xxxxxxxxxxx
Subject: [PATCH] xfstest: preallocate file space greater then MAXEXTLEN
From: Alain Renaud <arenaud@xxxxxxx>
Date: Fri, 13 Jul 2012 14:27:12 +0200
In-reply-to: <20120713122520.837966548@xxxxxxx>
References: <20120713122520.837966548@xxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120615 Thunderbird/13.0.1
xfstest: preallocate file space greater then MAXEXTLEN

This test is trying to reserve file space greater then the maximum size allow per extent, this also using extsize to see if the extsize
alignment does not overflow MAXEXTLEN.

You need to make sure that you are AG that are big enough to
contain the entire extent.

Signed-off-by: Alain Renaud <arenaud@xxxxxxx>
---
 288     |   88         88 +    0 -     0 !
 288.out |    2         2 +     0 -     0 !
 group   |    1         1 +     0 -     0 !
 3 files changed, 91 insertions(+)
 create mode 100755 288
 create mode 100644 288.out

Index: b/288
===================================================================
--- /dev/null
+++ b/288
@@ -0,0 +1,88 @@
+#! /bin/bash
+# FS QA Test No. 288
+#
+# test preallocation using value greater the maximum size for extent.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2012 SGI.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+#-----------------------------------------------------------------------
+#
+# creator
+owner=arenaud@xxxxxxx
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1       # failure is the default!
+trap "rm -f $tmp.*; 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
+
+_require_scratch
+
+rm -f $seq.full
+# Use a small block size so we do not need to much disk
+# space to get more the 2^21 block. Since the AG size
+# also need to be bigger then 2^21 block. let's create
+# a 4Gig filesystem with 1 AG.
+if ! _scratch_mkfs_xfs -b size=512 \
+    -d agcount=1,size=4294967296 >> $seq.full 2>&1
+then
+    echo "!!! failed to mkfs on $SCRATCH_DEV"
+    exit ${status}
+fi
+
+_scratch_mount
+
+if ! cd ${SCRATCH_MNT}
+then
+    echo "!!! failed to cd in SCRATCH_MNT"
+    exit ${status}
+fi
+
+mkdir testdir
+cd testdir
+xfs_io -c 'extsize 1m' .
+xfs_io -f -c 'resvsp 0 1g' testfile
+rm testfile
+xfs_io -f -c 'resvsp 512 1g' testfile
+rm testfile
+
+
+xfs_io -c 'extsize 4m' .
+xfs_io -f -c 'resvsp 0 1g' testfile
+rm testfile
+xfs_io -f -c 'resvsp 512 1g' testfile
+rm testfile
+
+
+cd "$here"
+
+_scratch_unmount
+echo "Silence is golden"
+
+# success, all done
+status=0
+exit
Index: b/288.out
===================================================================
--- /dev/null
+++ b/288.out
@@ -0,0 +1,2 @@
+QA output created by 288
+Silence is golden
Index: b/group
===================================================================
--- a/group
+++ b/group
@@ -406,3 +406,4 @@
 285 auto rw
 286 other
 287 auto rw
+288 auto quick rw

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] xfstest: preallocate file space greater then MAXEXTLEN, Alain Renaud <=