Skip to contentSkip to conversation

xfststests 220: test for prealloc/delalloc/reserved space recapture

PATCH In review Eric Sandeen 2 participants 3 messages Oct 1, 2009 – Nov 2, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfststests 220: test for prealloc/delalloc/reserved space recapture

Test writing and removing a file in a loop; filesize is 64m, filesystem size is 256m. Loop 16 times each for buffered and direct.

ext4 hits enospc after a couple loops.

---

(note this has the sized mkfs infra from the previous patch this week since that patch needed more work w.r.t. modifying existing tests)

common.rc +0 -0
index 761170d..8d0cd4e 100644
@@ -237,6 +237,27 @@ _scratch_mkfs_options()
    echo $SCRATCH_OPTIONS $MKFS_OPTIONS $* $SCRATCH_DEV

}

+# arg 1 is size in bytes, arg 2 is (optional) blocksize +_scratch_mkfs_sized()
+{

+    fssz=$1
+    bsz=$2
+    [ -z "$bsz" ] && bsz=4096
+    let blocks=$fssz/$bsz

+
+ case $FSTYP in
+ xfs)
+ _scratch_mkfs_xfs -d size=$fssz -b size=$bsz 2>&1 >>$here/$seq.full
+ ;;
+ ext2|ext3|ext4)
+ /sbin/mkfs -t $FSTYP -- $MKFS_OPTIONS -b $bsz $SCRATCH_DEV $blocks 2>&1>>$here/$seq.full

+    ;;
+    *)
+    _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized"
+    ;;
+    esac

+}
+
_scratch_mkfs_xfs()
{

    # extra mkfs options can be added by tests
220 new file +75 -0

75 lines not on this page · raw message

220.out new file +5 -0
new file mode 100644
index 0000000..497a585
@@ -0,0 +1,6 @@
+QA output created by 220
+--> mkfs 256m filesystem
+--> 16 buffered 64m writes in a loop
+1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 +--> 16 direct 64m writes in a loop
+1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 diff --git a/group b/group

index 7cea01d..9b8a401 100644

group +0 -0
@@ -329,3 +329,4 @@ prealloc

217 log metadata auto
218 auto fsr quick
219 auto quota quick
+220 enospc auto quick

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 1/1
#1 lore raw

RE: [PATCH] xfststests 220: test for prealloc/delalloc/reserved spacerecapture

Quoted 8 lines · Eric Sandeen

Test writing and removing a file in a loop; filesize is 64m, filesystem size is 256m. Loop 16 times each for buffered and direct.

ext4 hits enospc after a couple loops.

---

Dumb nit mentioned below, but otherwise looks good. Also note that you'll need to use a different test number now--like 221.

Quoted 75 lines

(note this has the sized mkfs infra from the previous patch this week since that patch needed more work w.r.t. modifying existing tests)

common.rc +20 -0
index 761170d..8d0cd4e 100644
@@ -237,6 +237,27 @@ _scratch_mkfs_options()
     echo $SCRATCH_OPTIONS $MKFS_OPTIONS $* $SCRATCH_DEV
 }
 
+# arg 1 is size in bytes, arg 2 is (optional) blocksize
+_scratch_mkfs_sized()
+{
+    fssz=$1
+    bsz=$2
+    [ -z "$bsz" ] && bsz=4096
+    let blocks=$fssz/$bsz
+
+    case $FSTYP in
+    xfs)
+        _scratch_mkfs_xfs -d size=$fssz -b size=$bsz 2>&1 >>$here/$seq.full
+    ;;
+    ext2|ext3|ext4)
+        /sbin/mkfs -t $FSTYP -- $MKFS_OPTIONS -b $bsz $SCRATCH_DEV $blocks 
 2>&1>>$here/$seq.full +    ;;
+    *)
+    _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized"
+    ;;
+    esac
+}
+
 _scratch_mkfs_xfs()
 {
     # extra mkfs options can be added by tests
220 new file +33 -0
new file mode 100755
index 0000000..55982b7
@@ -0,0 +1,76 @@
+#! /bin/sh
+# FS QA Test No. 220
+#
+# Test for prealloc space leaks by rewriting the same file in a loop
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2009 Eric Sandeen.  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
[email protected]
+
+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

220 line 43

Quoted 10 lines
220 new file +10 -0
+
+# get standard environment, filters and checks
+. ./common.rc
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux IRIX
+_require_scratch
+
+# real QA test starts here

So which is it, here or above that the "real QA test starts"?

Quoted 55 lines
220 new file +33 -0
+rm -f $seq.full
+
+umount $SCRATCH_DEV 2>/dev/null
+let fssize=256*1024*1024
+echo "--> mkfs 256m filesystem"
+_scratch_mkfs_sized $fssize >> $seq.full 2>&1
+_scratch_mount
+
+loops=16
+
+echo "--> $loops buffered 64m writes in a loop"
+for I in `seq 1 $loops`; do
+	echo -n "$I "
+	xfs_io -F -f -c 'pwrite 0 64m' $SCRATCH_MNT/test >> $seq.full
+	rm -f $SCRATCH_MNT/test
+done
+
+echo
+umount $SCRATCH_DEV
+_scratch_mount
+
+echo "--> $loops direct 64m writes in a loop"
+for I in `seq 1 $loops`; do
+	echo -n "$I "
+	xfs_io -F -f -d -c 'pwrite 0 64m' $SCRATCH_MNT/test >> $seq.full
+	rm -f $SCRATCH_MNT/test
+done
+
+echo
+umount $SCRATCH_DEV
+
+status=0
+exit
220.out new file +6 -0
new file mode 100644
index 0000000..497a585
@@ -0,0 +1,6 @@
+QA output created by 220
+--> mkfs 256m filesystem
+--> 16 buffered 64m writes in a loop
+1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
+--> 16 direct 64m writes in a loop
+1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
group +1 -0
index 7cea01d..9b8a401 100644
@@ -329,3 +329,4 @@ prealloc
 217 log metadata auto
 218 auto fsr quick
 219 auto quota quick
+220 enospc auto quick
Quoted 4 lines

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#2 lore raw

Re: [PATCH] xfststests 220: test for prealloc/delalloc/reserved spacerecapture

Quoted 18 lines · Alex Elder
Quoted 8 lines · Eric Sandeen

Test writing and removing a file in a loop; filesize is 64m, filesystem size is 256m. Loop 16 times each for buffered and direct.

ext4 hits enospc after a couple loops.

---

Dumb nit mentioned below, but otherwise looks good. Also note that you'll need to use a different test number now--like 221.

...

Quoted 8 lines

220 line 43

Quoted 6 lines
220 new file +6 -0
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux IRIX
+_require_scratch
+
+# real QA test starts here

So which is it, here or above that the "real QA test starts"?

It depends on how you measure the starting point, and in fact by measuring, you may affect the outcome of that measurement ... it could be both at the same time!

-Eric Heisenberg

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs