Backport #17684 to 2.3: config: Fix LLVM-21 -Wuninitialized-const-pointer warning #17997
+3
−6
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.
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. The blk_holder_ops are not used by the ZFS code so we can safely use a NULL argument for this check.
Reviewed-by: Rob Norris [email protected]
Closes #17682
Closes #17684
(cherry picked from commit 9acedba)
Motivation and Context
Builds with LLVM/Clang 21 fail due to the new -Wuninitialized-const-pointer warning. This prevents proper detection of the bdev_file_open_by_path() interface on kernel 6.9+.
Fixes #17959 and #17994
Description
This cherry-pick fixes a build failure with LLVM/Clang 21 by initializing the blk_holder_ops pointer to NULL in the bdev_file_open_by_path() configure check. Since ZFS doesn't use blk_holder_ops, this change is safe and allows the configure check to pass.
How Has This Been Tested?
Clean cherry-pick from the
masterbranch where it was already tested and reviewed.Types of changes
Checklist:
Signed-off-by.