From: Anand Jain <anand.jain@oracle.com>
To: fstests@vger.kernel.org
Cc: linux-btrfs@vger.kernel.org
Subject: [PATCH v4] geneirc/077 fix min size for btrfs
Date: Thu, 11 Oct 2018 15:55:28 +0800 [thread overview]
Message-ID: <1539244528-9647-1-git-send-email-anand.jain@oracle.com> (raw)
In-Reply-To: <1539228360-8575-1-git-send-email-anand.jain@oracle.com>
If btrfs need to be tested at its default blockgroup which is non-mixed,
then it needs at least 256mb.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
v3->v4: fix the check for the /usr or /lib/modules size. Thanks Darrick.
v2->v3:
separated from the patch set of 9.
notrun for the cases where filler is not big enough to fill the
fssize.
v2->v1: ref the cover-letter of the set.
tests/generic/077 | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/tests/generic/077 b/tests/generic/077
index ef6af18c83e3..284e25253c9e 100755
--- a/tests/generic/077
+++ b/tests/generic/077
@@ -13,11 +13,18 @@ echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=1
-# Something w/ enough data to fill 50M of fs...
-filler=/lib/modules/
-# fall back in case /lib/modules doesn't exist
-[ -d $filler ] || filler=/usr
+# Something w/ enough data to fill 256M of fs...
+filler=""
+[ -d /lib/modules ] && \
+ [ $(( $(du -h -m /lib/modules | tail -1| cut -f1) * 2 )) -ge 256 ] && \
+ filler=/lib/modules
+
+# fall back in case /lib/modules doesn't exist or smaller
+[[ -z $filler ]] && \
+ [ -d /usr ] && \
+ [ $(( $(du -h -m /usr | tail -1| cut -f1) * 2 )) -ge 256 ] && \
+ filler=/usr
_cleanup()
{
@@ -36,7 +43,7 @@ trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
_supported_fs generic
_supported_os Linux
-[ ! -d $filler ] && _notrun "No directory to source files from"
+[ ! -d $filler ] && _notrun "No directory at least 256MB to source files from"
_require_scratch
_require_attrs
@@ -49,9 +56,8 @@ rm -f $seqres.full
_scratch_unmount >/dev/null 2>&1
echo "*** MKFS ***" >>$seqres.full
echo "" >>$seqres.full
-SIZE=`expr 50 \* 1024 \* 1024`
-_scratch_mkfs_sized $SIZE >>$seqres.full 2>&1 \
- || _fail "mkfs failed"
+fs_size=$((256 * 1024 * 1024))
+_scratch_mkfs_sized $fs_size >> $seqres.full 2>&1 || _fail "mkfs failed"
_scratch_mount
mkdir $SCRATCH_MNT/subdir
--
1.8.3.1
prev parent reply other threads:[~2018-10-11 7:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-11 3:26 [PATCH v3] geneirc/077 fix min size for btrfs Anand Jain
2018-10-11 4:25 ` Darrick J. Wong
2018-10-11 7:55 ` Anand Jain
2018-10-11 7:55 ` Anand Jain [this message]
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=1539244528-9647-1-git-send-email-anand.jain@oracle.com \
--to=anand.jain@oracle.com \
--cc=fstests@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).