diff mbox series

[V2,3/3] xfs/300: modify test to work on any fs block size

Message ID 20200220200632.14075-4-jmoyer@redhat.com (mailing list archive)
State New, archived
Headers show
Series fstests: fixes for 64k pages and dax | expand

Commit Message

Jeff Moyer Feb. 20, 2020, 8:06 p.m. UTC
The test currently assumes a file system block size of 4k.  It will
work just fine on any user-specified block size, though.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
---
 tests/xfs/300 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Zorro Lang Feb. 22, 2020, 5:31 a.m. UTC | #1
On Thu, Feb 20, 2020 at 03:06:32PM -0500, Jeff Moyer wrote:
> The test currently assumes a file system block size of 4k.  It will
> work just fine on any user-specified block size, though.
> 
> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
> ---
>  tests/xfs/300 | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/xfs/300 b/tests/xfs/300
> index 28608b81..4f1c927a 100755
> --- a/tests/xfs/300
> +++ b/tests/xfs/300
> @@ -50,8 +50,9 @@ $XFS_IO_PROG -f -c "pwrite -S 0x63 0 4096" $SCRATCH_MNT/attrvals >> $seqres.full
>  cat $SCRATCH_MNT/attrvals | attr -s name $SCRATCH_MNT/$seq.test >> $seqres.full 2>&1
>  
>  # Fragment the file by writing backwards
> +bs=$(_get_file_block_size $SCRATCH_MNT)
>  for I in `seq 6 -1 0`; do
> -	dd if=/dev/zero of=$SCRATCH_MNT/$seq.test seek=$I bs=4k \
> +	dd if=/dev/zero of=$SCRATCH_MNT/$seq.test seek=$I bs=${bs} \

Although the original case won't fail on 64k test. But this change makes
more sense.

Thanks,
Zorro

>  	   oflag=direct count=1 conv=notrunc >> $seqres.full 2>&1
>  done
>  
> -- 
> 2.19.1
>
Jeff Moyer Feb. 24, 2020, 1:46 p.m. UTC | #2
Zorro Lang <zlang@redhat.com> writes:

> On Thu, Feb 20, 2020 at 03:06:32PM -0500, Jeff Moyer wrote:
>> The test currently assumes a file system block size of 4k.  It will
>> work just fine on any user-specified block size, though.
>> 
>> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
>> ---
>>  tests/xfs/300 | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>> 
>> diff --git a/tests/xfs/300 b/tests/xfs/300
>> index 28608b81..4f1c927a 100755
>> --- a/tests/xfs/300
>> +++ b/tests/xfs/300
>> @@ -50,8 +50,9 @@ $XFS_IO_PROG -f -c "pwrite -S 0x63 0 4096" $SCRATCH_MNT/attrvals >> $seqres.full
>>  cat $SCRATCH_MNT/attrvals | attr -s name $SCRATCH_MNT/$seq.test >> $seqres.full 2>&1
>>  
>>  # Fragment the file by writing backwards
>> +bs=$(_get_file_block_size $SCRATCH_MNT)
>>  for I in `seq 6 -1 0`; do
>> -	dd if=/dev/zero of=$SCRATCH_MNT/$seq.test seek=$I bs=4k \
>> +	dd if=/dev/zero of=$SCRATCH_MNT/$seq.test seek=$I bs=${bs} \
>
> Although the original case won't fail on 64k test. But this change makes
> more sense.

It will fail for the case mentioned in the cover letter.  That is:

MKFS_OPTIONS="-m reflink=0 -b size=65536" MOUNT_OPTIONS="-o dax"

on a system with >4k page size (xfs, in this case).

Thanks,
Jeff
diff mbox series

Patch

diff --git a/tests/xfs/300 b/tests/xfs/300
index 28608b81..4f1c927a 100755
--- a/tests/xfs/300
+++ b/tests/xfs/300
@@ -50,8 +50,9 @@  $XFS_IO_PROG -f -c "pwrite -S 0x63 0 4096" $SCRATCH_MNT/attrvals >> $seqres.full
 cat $SCRATCH_MNT/attrvals | attr -s name $SCRATCH_MNT/$seq.test >> $seqres.full 2>&1
 
 # Fragment the file by writing backwards
+bs=$(_get_file_block_size $SCRATCH_MNT)
 for I in `seq 6 -1 0`; do
-	dd if=/dev/zero of=$SCRATCH_MNT/$seq.test seek=$I bs=4k \
+	dd if=/dev/zero of=$SCRATCH_MNT/$seq.test seek=$I bs=${bs} \
 	   oflag=direct count=1 conv=notrunc >> $seqres.full 2>&1
 done