All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Paulson <paul.paulson@seagate.com>
To: fstests@vger.kernel.org
Cc: linux-ext4@vger.kernel.org, Paul Paulson <paul.paulson@seagate.com>
Subject: [PATCH] generic/017: skip tests with mkfs failures
Date: Mon,  6 Oct 2014 13:23:50 -0500	[thread overview]
Message-ID: <1412619830-23088-1-git-send-email-paul.paulson@seagate.com> (raw)

The mkfs command fails to create ext4 filesystems on partition sizes
greater than 1998080 MiB when using 1024 byte blocks and the default
calculation for the number of inodes reserved for the filesystem.

The following error message is produced when the maximum number of
inodes is exceeded:

    "Cannot create filesystem with requested number of inodes while
     setting up superblock"

The generic/017 test was modified to skip the 1K block size test
for partitions with an inode count that exceeds the maximum.

The QA output for the test was also changed to a simple pass/fail
indication to account for a variable number of test iterations.
---
 common/config         |  1 +
 tests/generic/017     | 21 +++++++++++++++++++--
 tests/generic/017.out |  4 +---
 3 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/common/config b/common/config
index d68d4d0..824985e 100644
--- a/common/config
+++ b/common/config
@@ -184,6 +184,7 @@ export LOGGER_PROG="`set_prog_path logger`"
 export DBENCH_PROG="`set_prog_path dbench`"
 export DMSETUP_PROG="`set_prog_path dmsetup`"
 export WIPEFS_PROG="`set_prog_path wipefs`"
+export TUNE2FS_PROG="`set_prog_path tune2fs`"
 
 # Generate a comparable xfsprogs version number in the form of
 # major * 10000 + minor * 100 + release
diff --git a/tests/generic/017 b/tests/generic/017
index 13b7254..eb38d4d 100755
--- a/tests/generic/017
+++ b/tests/generic/017
@@ -49,8 +49,16 @@ _do_die_on_error=y
 testfile=$SCRATCH_MNT/$seq.$$
 BLOCKS=10240
 
-for (( BSIZE = 1024; BSIZE <= 4096; BSIZE *= 2 )); do
+MAX_INODE_COUNT_1K=127877120
+inode_count=`$TUNE2FS_PROG -l $SCRATCH_DEV | awk '/Inode count:/ { print $3 }'`
+initial_bsize=$(($inode_count <= $MAX_INODE_COUNT_1K ? 1024 : 2048))
 
+iterations=0
+passcount=0
+
+for (( BSIZE = $initial_bsize; BSIZE <= 4096; BSIZE *= 2 )); do
+
+	let iterations++
 	length=$(($BLOCKS * $BSIZE))
 	case $FSTYP in
 	xfs)
@@ -74,7 +82,10 @@ for (( BSIZE = 1024; BSIZE <= 4096; BSIZE *= 2 )); do
 	done
 
 	# Check if 80 extents are present
-	$XFS_IO_PROG -c "fiemap -v" $testfile | grep "^ *[0-9]*:" |wc -l
+	extents=`$XFS_IO_PROG -c "fiemap -v" $testfile | grep "^ *[0-9]*:" | wc -l`
+	if [ $extents -eq 80 ]; then
+		let passcount++
+	fi
 
 	_check_scratch_fs
 	if [ $? -ne 0 ]; then
@@ -85,6 +96,12 @@ for (( BSIZE = 1024; BSIZE <= 4096; BSIZE *= 2 )); do
 	umount $SCRATCH_MNT
 done
 
+if [ $iterations -gt 0 -a $passcount -eq $iterations ]; then
+	echo pass
+else
+	echo fail
+fi
+
 # success, all done
 status=0
 exit
diff --git a/tests/generic/017.out b/tests/generic/017.out
index cc524ac..008ac18 100644
--- a/tests/generic/017.out
+++ b/tests/generic/017.out
@@ -1,4 +1,2 @@
 QA output created by 017
-80
-80
-80
+pass
-- 
1.9.1


             reply	other threads:[~2014-10-06 18:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-06 18:23 Paul Paulson [this message]
2014-10-06 23:21 ` [PATCH] generic/017: skip tests with mkfs failures Dave Chinner
2014-10-07 18:18   ` Paul Paulson
2014-10-07  0:53 ` Theodore Ts'o
2014-10-07 18:12   ` Paul Paulson
2014-10-08  2:11     ` Theodore Ts'o
2014-10-08 13:17       ` Paul Paulson

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=1412619830-23088-1-git-send-email-paul.paulson@seagate.com \
    --to=paul.paulson@seagate.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-ext4@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.