fstests: Fix tests to execute in multi-block directory config
authorChandan Babu R <chandanrlinux@gmail.com>
Fri, 2 Apr 2021 02:49:40 +0000 (08:19 +0530)
committerEryu Guan <guaneryu@gmail.com>
Sun, 11 Apr 2021 08:36:41 +0000 (16:36 +0800)
commit172b311e6f431ee9eaa023091acbf22ed0e7c074
treedf7b1e8f6f1f97ae96dc30e8e8e274a8cf6a8fec
parentf3172bbedcf31d7685098b15407516b82ebad30e
fstests: Fix tests to execute in multi-block directory config

xfs/{529,531,532,534,535} attempt to create test files after injecting
reduce_max_iextents error tag. Creation of test 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 test files before injecting
reduce_max_iextents error tag.

Reported-by: Darrick J. Wong <djwong@kernel.org>
Suggested-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/xfs/529
tests/xfs/529.out
tests/xfs/531
tests/xfs/531.out
tests/xfs/532
tests/xfs/532.out
tests/xfs/534
tests/xfs/534.out
tests/xfs/535
tests/xfs/535.out