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.
Currently, in several instances (but not all), ztest generates vdev file paths using a statement similar to this:
This worked fine until 40b84e7, which changed
path
to be a pointer to the heap instead of an array allocated on the stack. Before this change,sizeof(path)
would return the size of the array; now, it returns the size of the pointer instead.As a result, the aforementioned
sprintf
statement uses the wrong size and truncates the vdev file path to the first 4 or 8 bytes (depending on the architecture). Typically, with default settings, the file path will become/tmp/zt
instead of/test/ztest.XXX
.This issue only exists in
ztest_vdev_attach_detach()
andztest_fault_inject()
, which explains why ztest doesn't fail right away.