linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] generic/017: skip tests with mkfs failures
@ 2014-10-06 18:23 Paul Paulson
  2014-10-06 23:21 ` Dave Chinner
  2014-10-07  0:53 ` Theodore Ts'o
  0 siblings, 2 replies; 7+ messages in thread
From: Paul Paulson @ 2014-10-06 18:23 UTC (permalink / raw)
  To: fstests; +Cc: linux-ext4, Paul Paulson

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-10-08 13:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-06 18:23 [PATCH] generic/017: skip tests with mkfs failures Paul Paulson
2014-10-06 23:21 ` 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

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).