fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] xfs/529: Execute chown on an existing directory entry
@ 2021-03-25 14:08 Chandan Babu R
  2021-03-25 14:08 ` [PATCH 2/6] xfs/529: Fix test to execute in multi-block directory config Chandan Babu R
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Chandan Babu R @ 2021-03-25 14:08 UTC (permalink / raw)
  To: linux-xfs, fstests; +Cc: Chandan Babu R

chown command is being executed on $testfile which is actually deleted just
before the execution of quota inode extent count overflow test. Hence the test
was not getting exercised at all.

This commit fixes the bug by using $fillerdir as the target of chown command.

Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
---
 tests/xfs/529 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/xfs/529 b/tests/xfs/529
index 778f6142..abe5b1e0 100755
--- a/tests/xfs/529
+++ b/tests/xfs/529
@@ -150,7 +150,7 @@ nr_quotas=$((nr_quotas_per_block * nr_blks))
 
 echo "Extend uquota file"
 for i in $(seq 0 $nr_quotas_per_block $nr_quotas); do
-	chown $i $testfile >> $seqres.full 2>&1
+	chown $i $fillerdir >> $seqres.full 2>&1
 	[[ $? != 0 ]] && break
 done
 
-- 
2.29.2


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

* [PATCH 2/6] xfs/529: Fix test to execute in multi-block directory config
  2021-03-25 14:08 [PATCH 1/6] xfs/529: Execute chown on an existing directory entry Chandan Babu R
@ 2021-03-25 14:08 ` Chandan Babu R
  2021-03-28 16:49   ` Eryu Guan
  2021-03-29 16:20   ` Darrick J. Wong
  2021-03-25 14:08 ` [PATCH 3/6] xfs/531: " Chandan Babu R
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 13+ messages in thread
From: Chandan Babu R @ 2021-03-25 14:08 UTC (permalink / raw)
  To: linux-xfs, fstests; +Cc: Chandan Babu R, Darrick J . Wong

xfs/529 attempts to create $testfile after reduce_max_iextents error tag is
injected. Creation of $testfile fails when using a multi-block directory test
configuration because,
1. A directory can have a pseudo maximum extent count of 10.
2. In the worst case a directory entry creation operation can consume
   (XFS_DA_NODE_MAXDEPTH + 1 + 1) * (Nr fs blocks in a single directory block)
   extents.
   With 1k fs block size and 4k directory block size, this evaluates to,
   (5 + 1 + 1) * 4
   = 7 * 4
   = 28
   > 10 (Pseudo maximum inode extent count).

This commit fixes the issue by creating $testfile before injecting
reduce_max_iextents error tag.

Reported-by: Darrick J. Wong <djwong@kernel.org>
Suggested-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
---
 tests/xfs/529     | 24 +++++++++++++++++++++---
 tests/xfs/529.out |  6 +++++-
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/tests/xfs/529 b/tests/xfs/529
index abe5b1e0..b4533eba 100755
--- a/tests/xfs/529
+++ b/tests/xfs/529
@@ -54,6 +54,8 @@ echo "* Delalloc to written extent conversion"
 
 testfile=$SCRATCH_MNT/testfile
 
+touch $testfile
+
 echo "Inject reduce_max_iextents error tag"
 _scratch_inject_error reduce_max_iextents 1
 
@@ -74,10 +76,18 @@ if (( $nextents > 10 )); then
 	exit 1
 fi
 
+echo "Disable reduce_max_iextents error tag"
+_scratch_inject_error reduce_max_iextents 0
+
 rm $testfile
 
 echo "* Fallocate unwritten extents"
 
+touch $testfile
+
+echo "Inject reduce_max_iextents error tag"
+_scratch_inject_error reduce_max_iextents 1
+
 echo "Fallocate fragmented file"
 for i in $(seq 0 2 $((nr_blks - 1))); do
 	$XFS_IO_PROG -f -c "falloc $((i * bsize)) $bsize" $testfile \
@@ -93,10 +103,18 @@ if (( $nextents > 10 )); then
 	exit 1
 fi
 
+echo "Disable reduce_max_iextents error tag"
+_scratch_inject_error reduce_max_iextents 0
+
 rm $testfile
 
 echo "* Directio write"
 
+touch $testfile
+
+echo "Inject reduce_max_iextents error tag"
+_scratch_inject_error reduce_max_iextents 1
+
 echo "Create fragmented file via directio writes"
 for i in $(seq 0 2 $((nr_blks - 1))); do
 	$XFS_IO_PROG -d -s -f -c "pwrite $((i * bsize)) $bsize" $testfile \
@@ -112,15 +130,15 @@ if (( $nextents > 10 )); then
 	exit 1
 fi
 
+echo "Disable reduce_max_iextents error tag"
+_scratch_inject_error reduce_max_iextents 0
+
 rm $testfile
 
 # Check if XFS gracefully returns with an error code when we try to increase
 # extent count of user quota inode beyond the pseudo max extent count limit.
 echo "* Extend quota inodes"
 
-echo "Disable reduce_max_iextents error tag"
-_scratch_inject_error reduce_max_iextents 0
-
 echo "Consume free space"
 fillerdir=$SCRATCH_MNT/fillerdir
 nr_free_blks=$(stat -f -c '%f' $SCRATCH_MNT)
diff --git a/tests/xfs/529.out b/tests/xfs/529.out
index b2ae3f42..13489d34 100644
--- a/tests/xfs/529.out
+++ b/tests/xfs/529.out
@@ -4,14 +4,18 @@ Format and mount fs
 Inject reduce_max_iextents error tag
 Create fragmented file
 Verify $testfile's extent count
+Disable reduce_max_iextents error tag
 * Fallocate unwritten extents
+Inject reduce_max_iextents error tag
 Fallocate fragmented file
 Verify $testfile's extent count
+Disable reduce_max_iextents error tag
 * Directio write
+Inject reduce_max_iextents error tag
 Create fragmented file via directio writes
 Verify $testfile's extent count
-* Extend quota inodes
 Disable reduce_max_iextents error tag
+* Extend quota inodes
 Consume free space
 Create fragmented filesystem
 Inject reduce_max_iextents error tag
-- 
2.29.2


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

* [PATCH 3/6] xfs/531: Fix test to execute in multi-block directory config
  2021-03-25 14:08 [PATCH 1/6] xfs/529: Execute chown on an existing directory entry Chandan Babu R
  2021-03-25 14:08 ` [PATCH 2/6] xfs/529: Fix test to execute in multi-block directory config Chandan Babu R
@ 2021-03-25 14:08 ` Chandan Babu R
  2021-03-29 18:05   ` Darrick J. Wong
  2021-03-25 14:08 ` [PATCH 4/6] xfs/532: " Chandan Babu R
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Chandan Babu R @ 2021-03-25 14:08 UTC (permalink / raw)
  To: linux-xfs, fstests; +Cc: Chandan Babu R, Darrick J . Wong

xfs/531 attempts to create $testfile after reduce_max_iextents error tag is
injected. Creation of $testfile fails when using a multi-block directory test
configuration because,
1. A directory can have a pseudo maximum extent count of 10.
2. In the worst case a directory entry creation operation can consume
   (XFS_DA_NODE_MAXDEPTH + 1 + 1) * (Nr fs blocks in a single directory block)
   extents.
   With 1k fs block size and 4k directory block size, this evaluates to,
   (5 + 1 + 1) * 4
   = 7 * 4
   = 28
   > 10 (Pseudo maximum inode extent count).

This commit fixes the issue by creating $testfile before injecting
reduce_max_iextents error tag.

Reported-by: Darrick J. Wong <djwong@kernel.org>
Suggested-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
---
 tests/xfs/531     | 11 ++++++++---
 tests/xfs/531.out |  9 ++++++++-
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/tests/xfs/531 b/tests/xfs/531
index caec7848..935c52b0 100755
--- a/tests/xfs/531
+++ b/tests/xfs/531
@@ -49,13 +49,15 @@ nr_blks=30
 
 testfile=$SCRATCH_MNT/testfile
 
-echo "Inject reduce_max_iextents error tag"
-_scratch_inject_error reduce_max_iextents 1
-
 for op in fpunch finsert fcollapse fzero; do
 	echo "* $op regular file"
 
 	echo "Create \$testfile"
+	touch $testfile
+
+	echo "Inject reduce_max_iextents error tag"
+	_scratch_inject_error reduce_max_iextents 1
+
 	$XFS_IO_PROG -f -s \
 		     -c "pwrite -b $((nr_blks * bsize)) 0 $((nr_blks * bsize))" \
 		     $testfile  >> $seqres.full
@@ -75,6 +77,9 @@ for op in fpunch finsert fcollapse fzero; do
 		exit 1
 	fi
 
+	echo "Disable reduce_max_iextents error tag"
+	_scratch_inject_error reduce_max_iextents 0
+
 	rm $testfile
 done
 
diff --git a/tests/xfs/531.out b/tests/xfs/531.out
index f85776c9..6ac90787 100644
--- a/tests/xfs/531.out
+++ b/tests/xfs/531.out
@@ -1,19 +1,26 @@
 QA output created by 531
 Format and mount fs
-Inject reduce_max_iextents error tag
 * fpunch regular file
 Create $testfile
+Inject reduce_max_iextents error tag
 fpunch alternating blocks
 Verify $testfile's extent count
+Disable reduce_max_iextents error tag
 * finsert regular file
 Create $testfile
+Inject reduce_max_iextents error tag
 finsert alternating blocks
 Verify $testfile's extent count
+Disable reduce_max_iextents error tag
 * fcollapse regular file
 Create $testfile
+Inject reduce_max_iextents error tag
 fcollapse alternating blocks
 Verify $testfile's extent count
+Disable reduce_max_iextents error tag
 * fzero regular file
 Create $testfile
+Inject reduce_max_iextents error tag
 fzero alternating blocks
 Verify $testfile's extent count
+Disable reduce_max_iextents error tag
-- 
2.29.2


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

* [PATCH 4/6] xfs/532: Fix test to execute in multi-block directory config
  2021-03-25 14:08 [PATCH 1/6] xfs/529: Execute chown on an existing directory entry Chandan Babu R
  2021-03-25 14:08 ` [PATCH 2/6] xfs/529: Fix test to execute in multi-block directory config Chandan Babu R
  2021-03-25 14:08 ` [PATCH 3/6] xfs/531: " Chandan Babu R
@ 2021-03-25 14:08 ` Chandan Babu R
  2021-03-29 18:05   ` Darrick J. Wong
  2021-03-25 14:08 ` [PATCH 5/6] xfs/534: " Chandan Babu R
  2021-03-25 14:08 ` [PATCH 6/6] xfs/535: " Chandan Babu R
  4 siblings, 1 reply; 13+ messages in thread
From: Chandan Babu R @ 2021-03-25 14:08 UTC (permalink / raw)
  To: linux-xfs, fstests; +Cc: Chandan Babu R, Darrick J . Wong

xfs/532 attempts to create $testfile after reduce_max_iextents error tag is
injected. Creation of $testfile fails when using a multi-block directory test
configuration because,
1. A directory can have a pseudo maximum extent count of 10.
2. In the worst case a directory entry creation operation can consume
   (XFS_DA_NODE_MAXDEPTH + 1 + 1) * (Nr fs blocks in a single directory block)
   extents.
   With 1k fs block size and 4k directory block size, this evaluates to,
   (5 + 1 + 1) * 4
   = 7 * 4
   = 28
   > 10 (Pseudo maximum inode extent count).

This commit fixes the issue by creating $testfile before injecting
reduce_max_iextents error tag.

Reported-by: Darrick J. Wong <djwong@kernel.org>
Suggested-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
---
 tests/xfs/532     | 17 ++++++++++-------
 tests/xfs/532.out |  6 +++---
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/tests/xfs/532 b/tests/xfs/532
index 1c789217..2bed574a 100755
--- a/tests/xfs/532
+++ b/tests/xfs/532
@@ -63,9 +63,6 @@ for dentry in $(ls -1 $fillerdir/); do
 	$here/src/punch-alternating $fillerdir/$dentry >> $seqres.full
 done
 
-echo "Inject reduce_max_iextents error tag"
-_scratch_inject_error reduce_max_iextents 1
-
 echo "Inject bmap_alloc_minlen_extent error tag"
 _scratch_inject_error bmap_alloc_minlen_extent 1
 
@@ -74,6 +71,9 @@ echo "* Set xattrs"
 echo "Create \$testfile"
 touch $testfile
 
+echo "Inject reduce_max_iextents error tag"
+_scratch_inject_error reduce_max_iextents 1
+
 echo "Create xattrs"
 nr_attrs=$((bsize * 20 / attr_len))
 for i in $(seq 1 $nr_attrs); do
@@ -90,6 +90,9 @@ if (( $naextents > 10 )); then
 	exit 1
 fi
 
+echo "Disable reduce_max_iextents error tag"
+_scratch_inject_error reduce_max_iextents 0
+
 echo "Remove \$testfile"
 rm $testfile
 
@@ -98,9 +101,6 @@ echo "* Remove xattrs"
 echo "Create \$testfile"
 touch $testfile
 
-echo "Disable reduce_max_iextents error tag"
-_scratch_inject_error reduce_max_iextents 0
-
 echo "Create initial xattr extents"
 
 naextents=0
@@ -132,7 +132,10 @@ if [[ $? == 0 ]]; then
 	exit 1
 fi
 
-rm $testfile && echo "Successfully removed \$testfile"
+echo "Disable reduce_max_iextents error tag"
+_scratch_inject_error reduce_max_iextents 0
+
+rm $testfile
 
 # success, all done
 status=0
diff --git a/tests/xfs/532.out b/tests/xfs/532.out
index 8e19d7bc..db52108f 100644
--- a/tests/xfs/532.out
+++ b/tests/xfs/532.out
@@ -2,17 +2,17 @@ QA output created by 532
 Format and mount fs
 Consume free space
 Create fragmented filesystem
-Inject reduce_max_iextents error tag
 Inject bmap_alloc_minlen_extent error tag
 * Set xattrs
 Create $testfile
+Inject reduce_max_iextents error tag
 Create xattrs
 Verify $testfile's naextent count
+Disable reduce_max_iextents error tag
 Remove $testfile
 * Remove xattrs
 Create $testfile
-Disable reduce_max_iextents error tag
 Create initial xattr extents
 Inject reduce_max_iextents error tag
 Remove xattr to trigger -EFBIG
-Successfully removed $testfile
+Disable reduce_max_iextents error tag
-- 
2.29.2


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

* [PATCH 5/6] xfs/534: Fix test to execute in multi-block directory config
  2021-03-25 14:08 [PATCH 1/6] xfs/529: Execute chown on an existing directory entry Chandan Babu R
                   ` (2 preceding siblings ...)
  2021-03-25 14:08 ` [PATCH 4/6] xfs/532: " Chandan Babu R
@ 2021-03-25 14:08 ` Chandan Babu R
  2021-03-29 18:06   ` Darrick J. Wong
  2021-03-25 14:08 ` [PATCH 6/6] xfs/535: " Chandan Babu R
  4 siblings, 1 reply; 13+ messages in thread
From: Chandan Babu R @ 2021-03-25 14:08 UTC (permalink / raw)
  To: linux-xfs, fstests; +Cc: Chandan Babu R, Darrick J . Wong

xfs/534 attempts to create $testfile after reduce_max_iextents error tag is
injected. Creation of $testfile fails when using a multi-block directory test
configuration because,
1. A directory can have a pseudo maximum extent count of 10.
2. In the worst case a directory entry creation operation can consume
   (XFS_DA_NODE_MAXDEPTH + 1 + 1) * (Nr fs blocks in a single directory block)
   extents.
   With 1k fs block size and 4k directory block size, this evaluates to,
   (5 + 1 + 1) * 4
   = 7 * 4
   = 28
   > 10 (Pseudo maximum inode extent count).

This commit fixes the issue by creating $testfile before injecting
reduce_max_iextents error tag.

Reported-by: Darrick J. Wong <djwong@kernel.org>
Suggested-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
---
 tests/xfs/534     | 9 ++++++---
 tests/xfs/534.out | 5 ++++-
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/tests/xfs/534 b/tests/xfs/534
index a8348526..338282ef 100755
--- a/tests/xfs/534
+++ b/tests/xfs/534
@@ -45,9 +45,6 @@ bsize=$(_get_file_block_size $SCRATCH_MNT)
 
 testfile=${SCRATCH_MNT}/testfile
 
-echo "Inject reduce_max_iextents error tag"
-_scratch_inject_error reduce_max_iextents 1
-
 nr_blks=15
 
 for io in Buffered Direct; do
@@ -62,6 +59,9 @@ for io in Buffered Direct; do
 		xfs_io_flag="-d"
 	fi
 
+	echo "Inject reduce_max_iextents error tag"
+	_scratch_inject_error reduce_max_iextents 1
+
 	echo "$io write to every other block of fallocated space"
 	for i in $(seq 1 2 $((nr_blks - 1))); do
 		$XFS_IO_PROG -f -s $xfs_io_flag -c "pwrite $((i * bsize)) $bsize" \
@@ -76,6 +76,9 @@ for io in Buffered Direct; do
 		exit 1
 	fi
 
+	echo "Disable reduce_max_iextents error tag"
+	_scratch_inject_error reduce_max_iextents 0
+
 	rm $testfile
 done
 
diff --git a/tests/xfs/534.out b/tests/xfs/534.out
index f7c0821b..0a0cd3a6 100644
--- a/tests/xfs/534.out
+++ b/tests/xfs/534.out
@@ -1,11 +1,14 @@
 QA output created by 534
 Format and mount fs
-Inject reduce_max_iextents error tag
 * Buffered write to unwritten extent
 Fallocate 15 blocks
+Inject reduce_max_iextents error tag
 Buffered write to every other block of fallocated space
 Verify $testfile's extent count
+Disable reduce_max_iextents error tag
 * Direct write to unwritten extent
 Fallocate 15 blocks
+Inject reduce_max_iextents error tag
 Direct write to every other block of fallocated space
 Verify $testfile's extent count
+Disable reduce_max_iextents error tag
-- 
2.29.2


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

* [PATCH 6/6] xfs/535: Fix test to execute in multi-block directory config
  2021-03-25 14:08 [PATCH 1/6] xfs/529: Execute chown on an existing directory entry Chandan Babu R
                   ` (3 preceding siblings ...)
  2021-03-25 14:08 ` [PATCH 5/6] xfs/534: " Chandan Babu R
@ 2021-03-25 14:08 ` Chandan Babu R
  2021-03-29 18:06   ` Darrick J. Wong
  4 siblings, 1 reply; 13+ messages in thread
From: Chandan Babu R @ 2021-03-25 14:08 UTC (permalink / raw)
  To: linux-xfs, fstests; +Cc: Chandan Babu R, Darrick J . Wong

xfs/535 attempts to create $srcfile and $dstfile after reduce_max_iextents
error tag is injected. Creation of these files fails when using a multi-block
directory test configuration because,
1. A directory can have a pseudo maximum extent count of 10.
2. In the worst case a directory entry creation operation can consume
   (XFS_DA_NODE_MAXDEPTH + 1 + 1) * (Nr fs blocks in a single directory block)
   extents.
   With 1k fs block size and 4k directory block size, this evaluates to,
   (5 + 1 + 1) * 4
   = 7 * 4
   = 28
   > 10 (Pseudo maximum inode extent count).

This commit fixes the issue by creating $srcfile and $dstfile before injecting
reduce_max_iextents error tag.

Reported-by: Darrick J. Wong <djwong@kernel.org>
Suggested-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
---
 tests/xfs/535     | 11 +++++++++++
 tests/xfs/535.out |  2 ++
 2 files changed, 13 insertions(+)

diff --git a/tests/xfs/535 b/tests/xfs/535
index 2d82624c..f2a8a3a5 100755
--- a/tests/xfs/535
+++ b/tests/xfs/535
@@ -51,6 +51,9 @@ nr_blks=15
 srcfile=${SCRATCH_MNT}/srcfile
 dstfile=${SCRATCH_MNT}/dstfile
 
+touch $srcfile
+touch $dstfile
+
 echo "Inject reduce_max_iextents error tag"
 _scratch_inject_error reduce_max_iextents 1
 
@@ -77,10 +80,18 @@ if (( $nextents > 10 )); then
 	exit 1
 fi
 
+echo "Disable reduce_max_iextents error tag"
+_scratch_inject_error reduce_max_iextents 0
+
 rm $dstfile
 
 echo "* Funshare shared extent"
 
+touch $dstfile
+
+echo "Inject reduce_max_iextents error tag"
+_scratch_inject_error reduce_max_iextents 1
+
 echo "Share the extent with \$dstfile"
 _reflink $srcfile $dstfile >> $seqres.full
 
diff --git a/tests/xfs/535.out b/tests/xfs/535.out
index 4383e921..8f600272 100644
--- a/tests/xfs/535.out
+++ b/tests/xfs/535.out
@@ -6,7 +6,9 @@ Create a $srcfile having an extent of length 15 blocks
 Share the extent with $dstfile
 Buffered write to every other block of $dstfile's shared extent
 Verify $dstfile's extent count
+Disable reduce_max_iextents error tag
 * Funshare shared extent
+Inject reduce_max_iextents error tag
 Share the extent with $dstfile
 Funshare every other block of $dstfile's shared extent
 Verify $dstfile's extent count
-- 
2.29.2


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

* Re: [PATCH 2/6] xfs/529: Fix test to execute in multi-block directory config
  2021-03-25 14:08 ` [PATCH 2/6] xfs/529: Fix test to execute in multi-block directory config Chandan Babu R
@ 2021-03-28 16:49   ` Eryu Guan
  2021-03-29 16:20   ` Darrick J. Wong
  1 sibling, 0 replies; 13+ messages in thread
From: Eryu Guan @ 2021-03-28 16:49 UTC (permalink / raw)
  To: Chandan Babu R; +Cc: linux-xfs, fstests, Darrick J . Wong

On Thu, Mar 25, 2021 at 07:38:53PM +0530, Chandan Babu R wrote:
> xfs/529 attempts to create $testfile after reduce_max_iextents error tag is
> injected. Creation of $testfile fails when using a multi-block directory test
> configuration because,
> 1. A directory can have a pseudo maximum extent count of 10.
> 2. In the worst case a directory entry creation operation can consume
>    (XFS_DA_NODE_MAXDEPTH + 1 + 1) * (Nr fs blocks in a single directory block)
>    extents.
>    With 1k fs block size and 4k directory block size, this evaluates to,
>    (5 + 1 + 1) * 4
>    = 7 * 4
>    = 28
>    > 10 (Pseudo maximum inode extent count).
> 
> This commit fixes the issue by creating $testfile before injecting
> reduce_max_iextents error tag.
> 
> Reported-by: Darrick J. Wong <djwong@kernel.org>
> Suggested-by: Darrick J. Wong <djwong@kernel.org>
> Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>

Seems patch 2 to 6 fix the same bug in different tests, I think we could
put the fixes in one patch.

Thanks,
Eryu
> ---
>  tests/xfs/529     | 24 +++++++++++++++++++++---
>  tests/xfs/529.out |  6 +++++-
>  2 files changed, 26 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/xfs/529 b/tests/xfs/529
> index abe5b1e0..b4533eba 100755
> --- a/tests/xfs/529
> +++ b/tests/xfs/529
> @@ -54,6 +54,8 @@ echo "* Delalloc to written extent conversion"
>  
>  testfile=$SCRATCH_MNT/testfile
>  
> +touch $testfile
> +
>  echo "Inject reduce_max_iextents error tag"
>  _scratch_inject_error reduce_max_iextents 1
>  
> @@ -74,10 +76,18 @@ if (( $nextents > 10 )); then
>  	exit 1
>  fi
>  
> +echo "Disable reduce_max_iextents error tag"
> +_scratch_inject_error reduce_max_iextents 0
> +
>  rm $testfile
>  
>  echo "* Fallocate unwritten extents"
>  
> +touch $testfile
> +
> +echo "Inject reduce_max_iextents error tag"
> +_scratch_inject_error reduce_max_iextents 1
> +
>  echo "Fallocate fragmented file"
>  for i in $(seq 0 2 $((nr_blks - 1))); do
>  	$XFS_IO_PROG -f -c "falloc $((i * bsize)) $bsize" $testfile \
> @@ -93,10 +103,18 @@ if (( $nextents > 10 )); then
>  	exit 1
>  fi
>  
> +echo "Disable reduce_max_iextents error tag"
> +_scratch_inject_error reduce_max_iextents 0
> +
>  rm $testfile
>  
>  echo "* Directio write"
>  
> +touch $testfile
> +
> +echo "Inject reduce_max_iextents error tag"
> +_scratch_inject_error reduce_max_iextents 1
> +
>  echo "Create fragmented file via directio writes"
>  for i in $(seq 0 2 $((nr_blks - 1))); do
>  	$XFS_IO_PROG -d -s -f -c "pwrite $((i * bsize)) $bsize" $testfile \
> @@ -112,15 +130,15 @@ if (( $nextents > 10 )); then
>  	exit 1
>  fi
>  
> +echo "Disable reduce_max_iextents error tag"
> +_scratch_inject_error reduce_max_iextents 0
> +
>  rm $testfile
>  
>  # Check if XFS gracefully returns with an error code when we try to increase
>  # extent count of user quota inode beyond the pseudo max extent count limit.
>  echo "* Extend quota inodes"
>  
> -echo "Disable reduce_max_iextents error tag"
> -_scratch_inject_error reduce_max_iextents 0
> -
>  echo "Consume free space"
>  fillerdir=$SCRATCH_MNT/fillerdir
>  nr_free_blks=$(stat -f -c '%f' $SCRATCH_MNT)
> diff --git a/tests/xfs/529.out b/tests/xfs/529.out
> index b2ae3f42..13489d34 100644
> --- a/tests/xfs/529.out
> +++ b/tests/xfs/529.out
> @@ -4,14 +4,18 @@ Format and mount fs
>  Inject reduce_max_iextents error tag
>  Create fragmented file
>  Verify $testfile's extent count
> +Disable reduce_max_iextents error tag
>  * Fallocate unwritten extents
> +Inject reduce_max_iextents error tag
>  Fallocate fragmented file
>  Verify $testfile's extent count
> +Disable reduce_max_iextents error tag
>  * Directio write
> +Inject reduce_max_iextents error tag
>  Create fragmented file via directio writes
>  Verify $testfile's extent count
> -* Extend quota inodes
>  Disable reduce_max_iextents error tag
> +* Extend quota inodes
>  Consume free space
>  Create fragmented filesystem
>  Inject reduce_max_iextents error tag
> -- 
> 2.29.2

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

* Re: [PATCH 2/6] xfs/529: Fix test to execute in multi-block directory config
  2021-03-25 14:08 ` [PATCH 2/6] xfs/529: Fix test to execute in multi-block directory config Chandan Babu R
  2021-03-28 16:49   ` Eryu Guan
@ 2021-03-29 16:20   ` Darrick J. Wong
  1 sibling, 0 replies; 13+ messages in thread
From: Darrick J. Wong @ 2021-03-29 16:20 UTC (permalink / raw)
  To: Chandan Babu R; +Cc: linux-xfs, fstests

On Thu, Mar 25, 2021 at 07:38:53PM +0530, Chandan Babu R wrote:
> xfs/529 attempts to create $testfile after reduce_max_iextents error tag is
> injected. Creation of $testfile fails when using a multi-block directory test
> configuration because,
> 1. A directory can have a pseudo maximum extent count of 10.
> 2. In the worst case a directory entry creation operation can consume
>    (XFS_DA_NODE_MAXDEPTH + 1 + 1) * (Nr fs blocks in a single directory block)
>    extents.
>    With 1k fs block size and 4k directory block size, this evaluates to,
>    (5 + 1 + 1) * 4
>    = 7 * 4
>    = 28
>    > 10 (Pseudo maximum inode extent count).
> 
> This commit fixes the issue by creating $testfile before injecting
> reduce_max_iextents error tag.
> 
> Reported-by: Darrick J. Wong <djwong@kernel.org>
> Suggested-by: Darrick J. Wong <djwong@kernel.org>
> Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>

Looks good to me,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  tests/xfs/529     | 24 +++++++++++++++++++++---
>  tests/xfs/529.out |  6 +++++-
>  2 files changed, 26 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/xfs/529 b/tests/xfs/529
> index abe5b1e0..b4533eba 100755
> --- a/tests/xfs/529
> +++ b/tests/xfs/529
> @@ -54,6 +54,8 @@ echo "* Delalloc to written extent conversion"
>  
>  testfile=$SCRATCH_MNT/testfile
>  
> +touch $testfile
> +
>  echo "Inject reduce_max_iextents error tag"
>  _scratch_inject_error reduce_max_iextents 1
>  
> @@ -74,10 +76,18 @@ if (( $nextents > 10 )); then
>  	exit 1
>  fi
>  
> +echo "Disable reduce_max_iextents error tag"
> +_scratch_inject_error reduce_max_iextents 0
> +
>  rm $testfile
>  
>  echo "* Fallocate unwritten extents"
>  
> +touch $testfile
> +
> +echo "Inject reduce_max_iextents error tag"
> +_scratch_inject_error reduce_max_iextents 1
> +
>  echo "Fallocate fragmented file"
>  for i in $(seq 0 2 $((nr_blks - 1))); do
>  	$XFS_IO_PROG -f -c "falloc $((i * bsize)) $bsize" $testfile \
> @@ -93,10 +103,18 @@ if (( $nextents > 10 )); then
>  	exit 1
>  fi
>  
> +echo "Disable reduce_max_iextents error tag"
> +_scratch_inject_error reduce_max_iextents 0
> +
>  rm $testfile
>  
>  echo "* Directio write"
>  
> +touch $testfile
> +
> +echo "Inject reduce_max_iextents error tag"
> +_scratch_inject_error reduce_max_iextents 1
> +
>  echo "Create fragmented file via directio writes"
>  for i in $(seq 0 2 $((nr_blks - 1))); do
>  	$XFS_IO_PROG -d -s -f -c "pwrite $((i * bsize)) $bsize" $testfile \
> @@ -112,15 +130,15 @@ if (( $nextents > 10 )); then
>  	exit 1
>  fi
>  
> +echo "Disable reduce_max_iextents error tag"
> +_scratch_inject_error reduce_max_iextents 0
> +
>  rm $testfile
>  
>  # Check if XFS gracefully returns with an error code when we try to increase
>  # extent count of user quota inode beyond the pseudo max extent count limit.
>  echo "* Extend quota inodes"
>  
> -echo "Disable reduce_max_iextents error tag"
> -_scratch_inject_error reduce_max_iextents 0
> -
>  echo "Consume free space"
>  fillerdir=$SCRATCH_MNT/fillerdir
>  nr_free_blks=$(stat -f -c '%f' $SCRATCH_MNT)
> diff --git a/tests/xfs/529.out b/tests/xfs/529.out
> index b2ae3f42..13489d34 100644
> --- a/tests/xfs/529.out
> +++ b/tests/xfs/529.out
> @@ -4,14 +4,18 @@ Format and mount fs
>  Inject reduce_max_iextents error tag
>  Create fragmented file
>  Verify $testfile's extent count
> +Disable reduce_max_iextents error tag
>  * Fallocate unwritten extents
> +Inject reduce_max_iextents error tag
>  Fallocate fragmented file
>  Verify $testfile's extent count
> +Disable reduce_max_iextents error tag
>  * Directio write
> +Inject reduce_max_iextents error tag
>  Create fragmented file via directio writes
>  Verify $testfile's extent count
> -* Extend quota inodes
>  Disable reduce_max_iextents error tag
> +* Extend quota inodes
>  Consume free space
>  Create fragmented filesystem
>  Inject reduce_max_iextents error tag
> -- 
> 2.29.2
> 

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

* Re: [PATCH 3/6] xfs/531: Fix test to execute in multi-block directory config
  2021-03-25 14:08 ` [PATCH 3/6] xfs/531: " Chandan Babu R
@ 2021-03-29 18:05   ` Darrick J. Wong
  0 siblings, 0 replies; 13+ messages in thread
From: Darrick J. Wong @ 2021-03-29 18:05 UTC (permalink / raw)
  To: Chandan Babu R; +Cc: linux-xfs, fstests

On Thu, Mar 25, 2021 at 07:38:54PM +0530, Chandan Babu R wrote:
> xfs/531 attempts to create $testfile after reduce_max_iextents error tag is
> injected. Creation of $testfile fails when using a multi-block directory test
> configuration because,
> 1. A directory can have a pseudo maximum extent count of 10.
> 2. In the worst case a directory entry creation operation can consume
>    (XFS_DA_NODE_MAXDEPTH + 1 + 1) * (Nr fs blocks in a single directory block)
>    extents.
>    With 1k fs block size and 4k directory block size, this evaluates to,
>    (5 + 1 + 1) * 4
>    = 7 * 4
>    = 28
>    > 10 (Pseudo maximum inode extent count).
> 
> This commit fixes the issue by creating $testfile before injecting
> reduce_max_iextents error tag.
> 
> Reported-by: Darrick J. Wong <djwong@kernel.org>
> Suggested-by: Darrick J. Wong <djwong@kernel.org>
> Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>

Much better,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  tests/xfs/531     | 11 ++++++++---
>  tests/xfs/531.out |  9 ++++++++-
>  2 files changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/xfs/531 b/tests/xfs/531
> index caec7848..935c52b0 100755
> --- a/tests/xfs/531
> +++ b/tests/xfs/531
> @@ -49,13 +49,15 @@ nr_blks=30
>  
>  testfile=$SCRATCH_MNT/testfile
>  
> -echo "Inject reduce_max_iextents error tag"
> -_scratch_inject_error reduce_max_iextents 1
> -
>  for op in fpunch finsert fcollapse fzero; do
>  	echo "* $op regular file"
>  
>  	echo "Create \$testfile"
> +	touch $testfile
> +
> +	echo "Inject reduce_max_iextents error tag"
> +	_scratch_inject_error reduce_max_iextents 1
> +
>  	$XFS_IO_PROG -f -s \
>  		     -c "pwrite -b $((nr_blks * bsize)) 0 $((nr_blks * bsize))" \
>  		     $testfile  >> $seqres.full
> @@ -75,6 +77,9 @@ for op in fpunch finsert fcollapse fzero; do
>  		exit 1
>  	fi
>  
> +	echo "Disable reduce_max_iextents error tag"
> +	_scratch_inject_error reduce_max_iextents 0
> +
>  	rm $testfile
>  done
>  
> diff --git a/tests/xfs/531.out b/tests/xfs/531.out
> index f85776c9..6ac90787 100644
> --- a/tests/xfs/531.out
> +++ b/tests/xfs/531.out
> @@ -1,19 +1,26 @@
>  QA output created by 531
>  Format and mount fs
> -Inject reduce_max_iextents error tag
>  * fpunch regular file
>  Create $testfile
> +Inject reduce_max_iextents error tag
>  fpunch alternating blocks
>  Verify $testfile's extent count
> +Disable reduce_max_iextents error tag
>  * finsert regular file
>  Create $testfile
> +Inject reduce_max_iextents error tag
>  finsert alternating blocks
>  Verify $testfile's extent count
> +Disable reduce_max_iextents error tag
>  * fcollapse regular file
>  Create $testfile
> +Inject reduce_max_iextents error tag
>  fcollapse alternating blocks
>  Verify $testfile's extent count
> +Disable reduce_max_iextents error tag
>  * fzero regular file
>  Create $testfile
> +Inject reduce_max_iextents error tag
>  fzero alternating blocks
>  Verify $testfile's extent count
> +Disable reduce_max_iextents error tag
> -- 
> 2.29.2
> 

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

* Re: [PATCH 4/6] xfs/532: Fix test to execute in multi-block directory config
  2021-03-25 14:08 ` [PATCH 4/6] xfs/532: " Chandan Babu R
@ 2021-03-29 18:05   ` Darrick J. Wong
  0 siblings, 0 replies; 13+ messages in thread
From: Darrick J. Wong @ 2021-03-29 18:05 UTC (permalink / raw)
  To: Chandan Babu R; +Cc: linux-xfs, fstests

On Thu, Mar 25, 2021 at 07:38:55PM +0530, Chandan Babu R wrote:
> xfs/532 attempts to create $testfile after reduce_max_iextents error tag is
> injected. Creation of $testfile fails when using a multi-block directory test
> configuration because,
> 1. A directory can have a pseudo maximum extent count of 10.
> 2. In the worst case a directory entry creation operation can consume
>    (XFS_DA_NODE_MAXDEPTH + 1 + 1) * (Nr fs blocks in a single directory block)
>    extents.
>    With 1k fs block size and 4k directory block size, this evaluates to,
>    (5 + 1 + 1) * 4
>    = 7 * 4
>    = 28
>    > 10 (Pseudo maximum inode extent count).
> 
> This commit fixes the issue by creating $testfile before injecting
> reduce_max_iextents error tag.
> 
> Reported-by: Darrick J. Wong <djwong@kernel.org>
> Suggested-by: Darrick J. Wong <djwong@kernel.org>
> Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>

Looks ok (and like Eryu says, this could all have been one large patch),
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  tests/xfs/532     | 17 ++++++++++-------
>  tests/xfs/532.out |  6 +++---
>  2 files changed, 13 insertions(+), 10 deletions(-)
> 
> diff --git a/tests/xfs/532 b/tests/xfs/532
> index 1c789217..2bed574a 100755
> --- a/tests/xfs/532
> +++ b/tests/xfs/532
> @@ -63,9 +63,6 @@ for dentry in $(ls -1 $fillerdir/); do
>  	$here/src/punch-alternating $fillerdir/$dentry >> $seqres.full
>  done
>  
> -echo "Inject reduce_max_iextents error tag"
> -_scratch_inject_error reduce_max_iextents 1
> -
>  echo "Inject bmap_alloc_minlen_extent error tag"
>  _scratch_inject_error bmap_alloc_minlen_extent 1
>  
> @@ -74,6 +71,9 @@ echo "* Set xattrs"
>  echo "Create \$testfile"
>  touch $testfile
>  
> +echo "Inject reduce_max_iextents error tag"
> +_scratch_inject_error reduce_max_iextents 1
> +
>  echo "Create xattrs"
>  nr_attrs=$((bsize * 20 / attr_len))
>  for i in $(seq 1 $nr_attrs); do
> @@ -90,6 +90,9 @@ if (( $naextents > 10 )); then
>  	exit 1
>  fi
>  
> +echo "Disable reduce_max_iextents error tag"
> +_scratch_inject_error reduce_max_iextents 0
> +
>  echo "Remove \$testfile"
>  rm $testfile
>  
> @@ -98,9 +101,6 @@ echo "* Remove xattrs"
>  echo "Create \$testfile"
>  touch $testfile
>  
> -echo "Disable reduce_max_iextents error tag"
> -_scratch_inject_error reduce_max_iextents 0
> -
>  echo "Create initial xattr extents"
>  
>  naextents=0
> @@ -132,7 +132,10 @@ if [[ $? == 0 ]]; then
>  	exit 1
>  fi
>  
> -rm $testfile && echo "Successfully removed \$testfile"
> +echo "Disable reduce_max_iextents error tag"
> +_scratch_inject_error reduce_max_iextents 0
> +
> +rm $testfile
>  
>  # success, all done
>  status=0
> diff --git a/tests/xfs/532.out b/tests/xfs/532.out
> index 8e19d7bc..db52108f 100644
> --- a/tests/xfs/532.out
> +++ b/tests/xfs/532.out
> @@ -2,17 +2,17 @@ QA output created by 532
>  Format and mount fs
>  Consume free space
>  Create fragmented filesystem
> -Inject reduce_max_iextents error tag
>  Inject bmap_alloc_minlen_extent error tag
>  * Set xattrs
>  Create $testfile
> +Inject reduce_max_iextents error tag
>  Create xattrs
>  Verify $testfile's naextent count
> +Disable reduce_max_iextents error tag
>  Remove $testfile
>  * Remove xattrs
>  Create $testfile
> -Disable reduce_max_iextents error tag
>  Create initial xattr extents
>  Inject reduce_max_iextents error tag
>  Remove xattr to trigger -EFBIG
> -Successfully removed $testfile
> +Disable reduce_max_iextents error tag
> -- 
> 2.29.2
> 

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

* Re: [PATCH 5/6] xfs/534: Fix test to execute in multi-block directory config
  2021-03-25 14:08 ` [PATCH 5/6] xfs/534: " Chandan Babu R
@ 2021-03-29 18:06   ` Darrick J. Wong
  0 siblings, 0 replies; 13+ messages in thread
From: Darrick J. Wong @ 2021-03-29 18:06 UTC (permalink / raw)
  To: Chandan Babu R; +Cc: linux-xfs, fstests

On Thu, Mar 25, 2021 at 07:38:56PM +0530, Chandan Babu R wrote:
> xfs/534 attempts to create $testfile after reduce_max_iextents error tag is
> injected. Creation of $testfile fails when using a multi-block directory test
> configuration because,
> 1. A directory can have a pseudo maximum extent count of 10.
> 2. In the worst case a directory entry creation operation can consume
>    (XFS_DA_NODE_MAXDEPTH + 1 + 1) * (Nr fs blocks in a single directory block)
>    extents.
>    With 1k fs block size and 4k directory block size, this evaluates to,
>    (5 + 1 + 1) * 4
>    = 7 * 4
>    = 28
>    > 10 (Pseudo maximum inode extent count).
> 
> This commit fixes the issue by creating $testfile before injecting
> reduce_max_iextents error tag.
> 
> Reported-by: Darrick J. Wong <djwong@kernel.org>
> Suggested-by: Darrick J. Wong <djwong@kernel.org>
> Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>

Looks good to me,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  tests/xfs/534     | 9 ++++++---
>  tests/xfs/534.out | 5 ++++-
>  2 files changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/xfs/534 b/tests/xfs/534
> index a8348526..338282ef 100755
> --- a/tests/xfs/534
> +++ b/tests/xfs/534
> @@ -45,9 +45,6 @@ bsize=$(_get_file_block_size $SCRATCH_MNT)
>  
>  testfile=${SCRATCH_MNT}/testfile
>  
> -echo "Inject reduce_max_iextents error tag"
> -_scratch_inject_error reduce_max_iextents 1
> -
>  nr_blks=15
>  
>  for io in Buffered Direct; do
> @@ -62,6 +59,9 @@ for io in Buffered Direct; do
>  		xfs_io_flag="-d"
>  	fi
>  
> +	echo "Inject reduce_max_iextents error tag"
> +	_scratch_inject_error reduce_max_iextents 1
> +
>  	echo "$io write to every other block of fallocated space"
>  	for i in $(seq 1 2 $((nr_blks - 1))); do
>  		$XFS_IO_PROG -f -s $xfs_io_flag -c "pwrite $((i * bsize)) $bsize" \
> @@ -76,6 +76,9 @@ for io in Buffered Direct; do
>  		exit 1
>  	fi
>  
> +	echo "Disable reduce_max_iextents error tag"
> +	_scratch_inject_error reduce_max_iextents 0
> +
>  	rm $testfile
>  done
>  
> diff --git a/tests/xfs/534.out b/tests/xfs/534.out
> index f7c0821b..0a0cd3a6 100644
> --- a/tests/xfs/534.out
> +++ b/tests/xfs/534.out
> @@ -1,11 +1,14 @@
>  QA output created by 534
>  Format and mount fs
> -Inject reduce_max_iextents error tag
>  * Buffered write to unwritten extent
>  Fallocate 15 blocks
> +Inject reduce_max_iextents error tag
>  Buffered write to every other block of fallocated space
>  Verify $testfile's extent count
> +Disable reduce_max_iextents error tag
>  * Direct write to unwritten extent
>  Fallocate 15 blocks
> +Inject reduce_max_iextents error tag
>  Direct write to every other block of fallocated space
>  Verify $testfile's extent count
> +Disable reduce_max_iextents error tag
> -- 
> 2.29.2
> 

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

* Re: [PATCH 6/6] xfs/535: Fix test to execute in multi-block directory config
  2021-03-25 14:08 ` [PATCH 6/6] xfs/535: " Chandan Babu R
@ 2021-03-29 18:06   ` Darrick J. Wong
  2021-03-30  3:49     ` Chandan Babu R
  0 siblings, 1 reply; 13+ messages in thread
From: Darrick J. Wong @ 2021-03-29 18:06 UTC (permalink / raw)
  To: Chandan Babu R; +Cc: linux-xfs, fstests

On Thu, Mar 25, 2021 at 07:38:57PM +0530, Chandan Babu R wrote:
> xfs/535 attempts to create $srcfile and $dstfile after reduce_max_iextents
> error tag is injected. Creation of these files fails when using a multi-block
> directory test configuration because,
> 1. A directory can have a pseudo maximum extent count of 10.
> 2. In the worst case a directory entry creation operation can consume
>    (XFS_DA_NODE_MAXDEPTH + 1 + 1) * (Nr fs blocks in a single directory block)
>    extents.
>    With 1k fs block size and 4k directory block size, this evaluates to,
>    (5 + 1 + 1) * 4
>    = 7 * 4
>    = 28
>    > 10 (Pseudo maximum inode extent count).
> 
> This commit fixes the issue by creating $srcfile and $dstfile before injecting
> reduce_max_iextents error tag.
> 
> Reported-by: Darrick J. Wong <djwong@kernel.org>
> Suggested-by: Darrick J. Wong <djwong@kernel.org>
> Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>

Now on to the xfs/538 regressions! ;)
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  tests/xfs/535     | 11 +++++++++++
>  tests/xfs/535.out |  2 ++
>  2 files changed, 13 insertions(+)
> 
> diff --git a/tests/xfs/535 b/tests/xfs/535
> index 2d82624c..f2a8a3a5 100755
> --- a/tests/xfs/535
> +++ b/tests/xfs/535
> @@ -51,6 +51,9 @@ nr_blks=15
>  srcfile=${SCRATCH_MNT}/srcfile
>  dstfile=${SCRATCH_MNT}/dstfile
>  
> +touch $srcfile
> +touch $dstfile
> +
>  echo "Inject reduce_max_iextents error tag"
>  _scratch_inject_error reduce_max_iextents 1
>  
> @@ -77,10 +80,18 @@ if (( $nextents > 10 )); then
>  	exit 1
>  fi
>  
> +echo "Disable reduce_max_iextents error tag"
> +_scratch_inject_error reduce_max_iextents 0
> +
>  rm $dstfile
>  
>  echo "* Funshare shared extent"
>  
> +touch $dstfile
> +
> +echo "Inject reduce_max_iextents error tag"
> +_scratch_inject_error reduce_max_iextents 1
> +
>  echo "Share the extent with \$dstfile"
>  _reflink $srcfile $dstfile >> $seqres.full
>  
> diff --git a/tests/xfs/535.out b/tests/xfs/535.out
> index 4383e921..8f600272 100644
> --- a/tests/xfs/535.out
> +++ b/tests/xfs/535.out
> @@ -6,7 +6,9 @@ Create a $srcfile having an extent of length 15 blocks
>  Share the extent with $dstfile
>  Buffered write to every other block of $dstfile's shared extent
>  Verify $dstfile's extent count
> +Disable reduce_max_iextents error tag
>  * Funshare shared extent
> +Inject reduce_max_iextents error tag
>  Share the extent with $dstfile
>  Funshare every other block of $dstfile's shared extent
>  Verify $dstfile's extent count
> -- 
> 2.29.2
> 

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

* Re: [PATCH 6/6] xfs/535: Fix test to execute in multi-block directory config
  2021-03-29 18:06   ` Darrick J. Wong
@ 2021-03-30  3:49     ` Chandan Babu R
  0 siblings, 0 replies; 13+ messages in thread
From: Chandan Babu R @ 2021-03-30  3:49 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, fstests

On 29 Mar 2021 at 23:36, Darrick J. Wong wrote:
> On Thu, Mar 25, 2021 at 07:38:57PM +0530, Chandan Babu R wrote:
>> xfs/535 attempts to create $srcfile and $dstfile after reduce_max_iextents
>> error tag is injected. Creation of these files fails when using a multi-block
>> directory test configuration because,
>> 1. A directory can have a pseudo maximum extent count of 10.
>> 2. In the worst case a directory entry creation operation can consume
>>    (XFS_DA_NODE_MAXDEPTH + 1 + 1) * (Nr fs blocks in a single directory block)
>>    extents.
>>    With 1k fs block size and 4k directory block size, this evaluates to,
>>    (5 + 1 + 1) * 4
>>    = 7 * 4
>>    = 28
>>    > 10 (Pseudo maximum inode extent count).
>> 
>> This commit fixes the issue by creating $srcfile and $dstfile before injecting
>> reduce_max_iextents error tag.
>> 
>> Reported-by: Darrick J. Wong <djwong@kernel.org>
>> Suggested-by: Darrick J. Wong <djwong@kernel.org>
>> Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
>
> Now on to the xfs/538 regressions! ;)

Yup, I am working on them.

> Reviewed-by: Darrick J. Wong <djwong@kernel.org>

Thanks for the review! I will fold patches 2 to 6 into a single patch and
repost.

-- 
chandan

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

end of thread, other threads:[~2021-03-30  3:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-25 14:08 [PATCH 1/6] xfs/529: Execute chown on an existing directory entry Chandan Babu R
2021-03-25 14:08 ` [PATCH 2/6] xfs/529: Fix test to execute in multi-block directory config Chandan Babu R
2021-03-28 16:49   ` Eryu Guan
2021-03-29 16:20   ` Darrick J. Wong
2021-03-25 14:08 ` [PATCH 3/6] xfs/531: " Chandan Babu R
2021-03-29 18:05   ` Darrick J. Wong
2021-03-25 14:08 ` [PATCH 4/6] xfs/532: " Chandan Babu R
2021-03-29 18:05   ` Darrick J. Wong
2021-03-25 14:08 ` [PATCH 5/6] xfs/534: " Chandan Babu R
2021-03-29 18:06   ` Darrick J. Wong
2021-03-25 14:08 ` [PATCH 6/6] xfs/535: " Chandan Babu R
2021-03-29 18:06   ` Darrick J. Wong
2021-03-30  3:49     ` Chandan Babu R

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).