From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: [PATCH 4/6] xfstests: Make 204 work with different block and inode sizes.
Date: Fri, 7 Jun 2013 23:06:36 +1000 [thread overview]
Message-ID: <1370610398-14630-5-git-send-email-david@fromorbit.com> (raw)
In-Reply-To: <1370610398-14630-1-git-send-email-david@fromorbit.com>
From: Dave Chinner <dchinner@redhat.com>
Otherwise it fails with ENOSPC on CRC enabled filesystems because
ofhte larger inode size.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
common/filter | 10 +++++++++-
tests/generic/204 | 37 ++++++++++++++++++++++++++++++++-----
2 files changed, 41 insertions(+), 6 deletions(-)
diff --git a/common/filter b/common/filter
index dbb1674..1bf9e9c 100644
--- a/common/filter
+++ b/common/filter
@@ -131,9 +131,17 @@ _filter_date()
}
# prints filtered output on stdout, values (use eval) on stderr
-#
+# Non XFS filesystems always return a 4k block size and a 256 byte inode.
_filter_mkfs()
{
+ case $FSTYP in
+ xfs)
+ ;;
+ *)
+ perl -e 'print STDERR "dbsize=4096\nisize=256\n"'
+ return ;;
+ esac
+
set -
perl -ne '
if (/^meta-data=([\w,|\/.-]+)\s+isize=(\d+)\s+agcount=(\d+), agsize=(\d+) blks/) {
diff --git a/tests/generic/204 b/tests/generic/204
index 62bd248..ecc9923 100755
--- a/tests/generic/204
+++ b/tests/generic/204
@@ -28,6 +28,12 @@ echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
@@ -39,20 +45,41 @@ _supported_os Linux
_require_scratch
+rm -f $seqres.full
+
+# get the block size first
+_scratch_mkfs 2> /dev/null | _filter_mkfs 2> $tmp.mkfs > /dev/null
+. $tmp.mkfs
+
SIZE=`expr 104 \* 1024 \* 1024`
-_scratch_mkfs_sized $SIZE &> /dev/null
+_scratch_mkfs_sized $SIZE $dbsize 2> /dev/null \
+ | _filter_mkfs 2> $tmp.mkfs > /dev/null
_scratch_mount
+. $tmp.mkfs
+
# fix the reserve block pool to a known size so that the enospc calculations
-# work out correctly.
-_scratch_resvblks 1024 > $seqres.full 2>&1
+# work out correctly. Space usages is based 22500 files and 1024 reserved blocks
+# on a 4k block size 256 byte inode size filesystem.
+resv_blks=1024
+space=97920000
-for i in `seq 1 22500`; do
+# decrease files for inode size.
+# 22500 * (256 + 4k) = ~97MB
+# files * (isize + bsize) = 97MB
+# files = (97920000 / (isize + bsize))
+
+files=$((space / (isize + dbsize)))
+resv_blks=$((resv_blks * (4096 / dbsize)))
+
+echo files $files, resvblks $resv_blks >> $seqres.full
+_scratch_resvblks $resv_blks >> $seqres.full 2>&1
+
+for i in `seq 1 $files`; do
echo -n > $SCRATCH_MNT/$i
echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > $SCRATCH_MNT/$i
done
# success, all done
echo "*** done"
-rm -f $seqres.full
status=0
--
1.7.10.4
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2013-06-07 13:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-07 13:06 [PATCH 0/6] xfstests: various fixes Dave Chinner
2013-06-07 13:06 ` [PATCH 1/6] xfstests: generic/193 runs tests in wrong location Dave Chinner
2013-06-25 19:49 ` Ben Myers
2013-06-07 13:06 ` [PATCH 2/6] xfstests: ensure all mkfs output is redirected properly Dave Chinner
2013-06-07 13:06 ` [PATCH 3/6] xfstests: xfs/253 doesn't use seqres correctly Dave Chinner
2013-06-25 20:27 ` Ben Myers
2013-06-07 13:06 ` Dave Chinner [this message]
2013-06-07 13:06 ` [PATCH 5/6] xfstests: New _require_* tests for CRC enabled filesystems Dave Chinner
2013-10-17 21:24 ` Eric Sandeen
2013-10-18 2:58 ` Dave Chinner
2013-06-07 13:06 ` [PATCH 6/6] xfstests: add a multithreaded mode to bstat Dave Chinner
2013-10-17 21:29 ` Eric Sandeen
2013-10-18 3:00 ` Dave Chinner
2013-10-18 3:39 ` Eric Sandeen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1370610398-14630-5-git-send-email-david@fromorbit.com \
--to=david@fromorbit.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox