ztest: Fix false positive of ENOSPC handling #17506
Open
+23
−16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[Sponsors: Klara, Inc., Wasabi Technology, Inc.]
Motivation and Context
It fixes a false positive when we want to free some space before the next pass but it may not take immediate effect due to
TXG_DEFER
window.Description
Calling
txg_wait_synced()
right after dataset deletion allows to make sure the freed space is allocatable before the next allocation event.In addition, this change switches
ztest_dataset_open()
call to an assertion inztest_generic_run()
. Otherwise, the failure path does not report about opening issue and leads to undefined behavior which is harder to diagnose. In my case I faced failure withztest_spa_import_export()
where it was not obvious to reason whyspa_export()
returnsEBUSY
, and it turned out that some test threads were still running and the actual root cause was the dataset open failure.How Has This Been Tested?
To improve the chances of the reproduction it was tested with 100%
ztest_dmu_read_write
, 0%ztest_kill
and 100%ztest_spa_import_export
checks after each pass. Literally it means this temporary patch:Types of changes
Checklist:
Signed-off-by
.