public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Zorro Lang <zlang@redhat.com>
To: fstests@vger.kernel.org
Cc: Zorro Lang <zlang@redhat.com>
Subject: [PATCH] xfs/032: avoid making a 512b block size V5 xfs
Date: Tue, 27 Sep 2016 23:23:35 +0800	[thread overview]
Message-ID: <1474989815-8202-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 I change the
minimum block size to 1024 if (crc = 1 && sector size < 1024).

Signed-off-by: Zorro Lang <zlang@redhat.com>
---
 tests/xfs/032 | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/tests/xfs/032 b/tests/xfs/032
index 6216379..487dbd9 100755
--- a/tests/xfs/032
+++ b/tests/xfs/032
@@ -34,6 +34,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
+. ./common/filter
 
 # real QA test starts here
 _supported_fs xfs
@@ -50,11 +51,22 @@ rm -f $seqres.full
 SECTORSIZE=`blockdev --getss $SCRATCH_DEV`
 PAGESIZE=`src/feature -s`
 IMGFILE=$TEST_DIR/${seq}_copy.img
+MIN_BLKSIZE=$SECTORSIZE
+
+if [ $MIN_BLKSIZE -lt 1024 ]; then
+	_scratch_mkfs_sized $((512 * 1024 * 1024)) | _filter_mkfs \
+						2>$tmp.mkfs >/dev/null
+	. $tmp.mkfs
+	if [ $_fs_has_crcs -eq 1 ]; then
+		MIN_BLKSIZE=1024
+	fi
+	rm -f $tmp.mkfs
+fi
 
 echo "Silence is golden."
 
 while [ $SECTORSIZE -le $PAGESIZE ]; do
-	BLOCKSIZE=$SECTORSIZE;
+	BLOCKSIZE=$MIN_BLKSIZE;
 
 	while [ $BLOCKSIZE -le $PAGESIZE ]; do
 
-- 
2.7.4


             reply	other threads:[~2016-09-27 15:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-27 15:23 Zorro Lang [this message]
2016-09-27 23:55 ` [PATCH] xfs/032: avoid making a 512b block size V5 xfs Dave Chinner

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=1474989815-8202-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox