xfs/014: try a few times to create speculative preallocations
authorDarrick J. Wong <djwong@kernel.org>
Tue, 4 Jan 2022 02:04:17 +0000 (18:04 -0800)
committerEryu Guan <guaneryu@gmail.com>
Thu, 6 Jan 2022 12:43:12 +0000 (20:43 +0800)
commitc0fd323596c5c086f920770a614a6c5bf615ad85
tree6b17c195ea05d26dc730d6a4a4db7c847c901032
parent8b9922c8a41aefde42f170d96cf936d8253398f3
xfs/014: try a few times to create speculative preallocations

This test checks that speculative file preallocations are transferred to
threads writing other files when space is low.  Since we have background
threads to clear those preallocations, it's possible that the test
program might not get a speculative preallocation on the first try.

This problem has become more pronounced since the introduction of
background inode inactivation since userspace no longer has direct
control over the timing of file blocks being released from unlinked
files.  As a result, the author has seen an increase in sporadic
warnings from this test about speculative preallocations not appearing.

Therefore, modify the function to try up to five times to create the
speculative preallocation before emitting warnings that then cause
golden output failures.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/xfs/014