config: Fix LLVM-21 -Wuninitialized-const-pointer warning #17684
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.
Motivation and Context
#17682
Description
By default LLVM-21 enables -Wuninitialized-const-pointer which results in the following compiler warning and the
bdev_file_open_by_path()interface not being detected for 6.9 and newer kernels. Theblk_holder_opsare not used by the ZFS code so we can safely use a NULL argument for this check.Note: Initially I was inclined to initialize the
blk_holder_opsstruct which is the approach we use elsewhere, but after discovering how many times that structure has changed I opted for the simpler more robust change to pass NULL.How Has This Been Tested?
Locally compiled, but not on all of the relevant kernels. The CI can help out some there, but we'll also want to do some manual testing with the relevant llvm versions.
Types of changes
Checklist:
Signed-off-by.