diff mbox series

[4/5] xfs/117: fix inode corruption loop

Message ID 158086092701.1989378.15455195869104309401.stgit@magnolia (mailing list archive)
State New, archived
Headers show
Series fstests: random fixes | expand

Commit Message

Darrick J. Wong Feb. 5, 2020, 12:02 a.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

`seq X Y` will print all numbers between X and Y, including Y.  Since
inode chunks contain inodes numbered from X to X+63, we need to set the
loop variables correctly.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/117 |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Zorro Lang Feb. 6, 2020, 4:50 a.m. UTC | #1
On Tue, Feb 04, 2020 at 04:02:07PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> `seq X Y` will print all numbers between X and Y, including Y.  Since
> inode chunks contain inodes numbered from X to X+63, we need to set the
> loop variables correctly.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  tests/xfs/117 |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 
> diff --git a/tests/xfs/117 b/tests/xfs/117
> index 0a7831d5..e3249623 100755
> --- a/tests/xfs/117
> +++ b/tests/xfs/117
> @@ -70,7 +70,7 @@ echo "+ check fs"
>  _scratch_xfs_repair -n >> $seqres.full 2>&1 || _fail "xfs_repair should not fail"
>  
>  echo "+ corrupt image"
> -seq "${inode}" "$((inode + 64))" | while read ino; do
> +seq "${inode}" "$((inode + 63))" | while read ino; do

This makes more sense, good to me.

>  	_scratch_xfs_db -x -c "inode ${ino}" -c "stack" -c "blocktrash -x 32 -y $((blksz * 8)) -z ${FUZZ_ARGS}" >> $seqres.full 2>&1
>  done
>  
>
diff mbox series

Patch

diff --git a/tests/xfs/117 b/tests/xfs/117
index 0a7831d5..e3249623 100755
--- a/tests/xfs/117
+++ b/tests/xfs/117
@@ -70,7 +70,7 @@  echo "+ check fs"
 _scratch_xfs_repair -n >> $seqres.full 2>&1 || _fail "xfs_repair should not fail"
 
 echo "+ corrupt image"
-seq "${inode}" "$((inode + 64))" | while read ino; do
+seq "${inode}" "$((inode + 63))" | while read ino; do
 	_scratch_xfs_db -x -c "inode ${ino}" -c "stack" -c "blocktrash -x 32 -y $((blksz * 8)) -z ${FUZZ_ARGS}" >> $seqres.full 2>&1
 done