All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] xfs/032: test the next block size if mkfs fails
@ 2016-09-30  6:58 Zorro Lang
  2016-09-30 11:57 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Zorro Lang @ 2016-09-30  6:58 UTC (permalink / raw)
  To: fstests

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


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

* Re: [PATCH v2] xfs/032: test the next block size if mkfs fails
  2016-09-30  6:58 [PATCH v2] xfs/032: test the next block size if mkfs fails Zorro Lang
@ 2016-09-30 11:57 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2016-09-30 11:57 UTC (permalink / raw)
  To: Zorro Lang; +Cc: fstests

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

end of thread, other threads:[~2016-09-30 11:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-30  6:58 [PATCH v2] xfs/032: test the next block size if mkfs fails Zorro Lang
2016-09-30 11:57 ` Christoph Hellwig

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.