diff mbox series

[15/24] xfs/194: actually check if we got 512-byte blocks before proceeding

Message ID 160013427110.2923511.12673259176007024613.stgit@magnolia
State New
Headers show
Series fstests: tons of random fixes | expand

Commit Message

Darrick J. Wong Sept. 15, 2020, 1:44 a.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

This test has specific fs block size requirements, so make sure that's
what we got before we proceed with the test.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/194 |    3 +++
 1 file changed, 3 insertions(+)

Comments

Zorro Lang Sept. 16, 2020, 11:34 a.m. UTC | #1
On Mon, Sep 14, 2020 at 06:44:31PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> This test has specific fs block size requirements, so make sure that's
> what we got before we proceed with the test.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  tests/xfs/194 |    3 +++
>  1 file changed, 3 insertions(+)
> 
> 
> diff --git a/tests/xfs/194 b/tests/xfs/194
> index 9001a146..90b74c8f 100755
> --- a/tests/xfs/194
> +++ b/tests/xfs/194
> @@ -84,6 +84,9 @@ unset XFS_MKFS_OPTIONS
>  # we need 512 byte block size, so crc's are turned off
>  _scratch_mkfs_xfs -m crc=0 -b size=$blksize >/dev/null 2>&1
>  _scratch_mount
> +test "$(_get_block_size $SCRATCH_MNT)" = 512 || \
> +	_notrun "Could not get 512-byte blocks"
> +

If this case is only for 512 byte blocksize, the "blksize=`expr $pgsize / 8`"
and all things with the "$blksize" looks redundant, right?

Thanks,
Zorro

>  
>  # 512b block / 4k page example:
>  #
>
Darrick J. Wong Sept. 16, 2020, 9:07 p.m. UTC | #2
On Wed, Sep 16, 2020 at 07:34:00PM +0800, Zorro Lang wrote:
> On Mon, Sep 14, 2020 at 06:44:31PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> > 
> > This test has specific fs block size requirements, so make sure that's
> > what we got before we proceed with the test.
> > 
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> >  tests/xfs/194 |    3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > 
> > diff --git a/tests/xfs/194 b/tests/xfs/194
> > index 9001a146..90b74c8f 100755
> > --- a/tests/xfs/194
> > +++ b/tests/xfs/194
> > @@ -84,6 +84,9 @@ unset XFS_MKFS_OPTIONS
> >  # we need 512 byte block size, so crc's are turned off
> >  _scratch_mkfs_xfs -m crc=0 -b size=$blksize >/dev/null 2>&1
> >  _scratch_mount
> > +test "$(_get_block_size $SCRATCH_MNT)" = 512 || \
> > +	_notrun "Could not get 512-byte blocks"
> > +
> 
> If this case is only for 512 byte blocksize, the "blksize=`expr $pgsize / 8`"
> and all things with the "$blksize" looks redundant, right?

Hmm... in hindsight I shouldn't have hardwired the right hand argument.
This needs only to be a simple equivalence test:

test "$(_get_block_size $SCRATCH_MNT)" = $blksize || \
	_notrun "Could not get $blksize-byte blocks"

Will fix and resend.

--D

> Thanks,
> Zorro
> 
> >  
> >  # 512b block / 4k page example:
> >  #
> > 
>
diff mbox series

Patch

diff --git a/tests/xfs/194 b/tests/xfs/194
index 9001a146..90b74c8f 100755
--- a/tests/xfs/194
+++ b/tests/xfs/194
@@ -84,6 +84,9 @@  unset XFS_MKFS_OPTIONS
 # we need 512 byte block size, so crc's are turned off
 _scratch_mkfs_xfs -m crc=0 -b size=$blksize >/dev/null 2>&1
 _scratch_mount
+test "$(_get_block_size $SCRATCH_MNT)" = 512 || \
+	_notrun "Could not get 512-byte blocks"
+
 
 # 512b block / 4k page example:
 #