All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zorro Lang <zlang@redhat.com>
To: fstests@vger.kernel.org
Subject: [PATCH v2] xfs/032: test the next block size if mkfs fails
Date: Fri, 30 Sep 2016 14:58:46 +0800	[thread overview]
Message-ID: <1475218726-22265-1-git-send-email-zlang@redhat.com> (raw)

If test on a 512b sector size device, xfs/032 will try to do:

  mkfs.xfs -s size=512 -b size=512 ...

The 512b block size is not acceptable for V5 XFS. So if mkfs.xfs
fails, try next block size (blksize *= 2) directly.

Signed-off-by: Zorro Lang <zlang@redhat.com>
---

V1 try to find the minimum acceptable block size at first, V2 drop
that method, and then *continue* the test if _scratch_mkfs return
error.

Thanks,
Zorro

 tests/xfs/032 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/xfs/032 b/tests/xfs/032
index 6216379..4b675ee 100755
--- a/tests/xfs/032
+++ b/tests/xfs/032
@@ -60,6 +60,11 @@ while [ $SECTORSIZE -le $PAGESIZE ]; do
 
 		echo "=== Sector size $SECTORSIZE Block size $BLOCKSIZE ==" >> $seqres.full
 		_scratch_mkfs -s size=$SECTORSIZE -b size=$BLOCKSIZE -d size=1g >> $seqres.full 2>&1
+		# Maybe return error at here, e.g: mkfs.xfs -m crc=1 -b size=512
+		if [ $? -ne 0 ]; then
+			BLOCKSIZE=$(($BLOCKSIZE * 2))
+			continue
+		fi
 		_scratch_mount
 		# light population of the fs
 		$FSSTRESS_PROG -n 100 -d $SCRATCH_MNT >> $seqres.full 2>&1
-- 
2.7.4


             reply	other threads:[~2016-09-30  6:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-30  6:58 Zorro Lang [this message]
2016-09-30 11:57 ` [PATCH v2] xfs/032: test the next block size if mkfs fails Christoph Hellwig

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=1475218726-22265-1-git-send-email-zlang@redhat.com \
    --to=zlang@redhat.com \
    --cc=fstests@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.