map: avoid misleading error message for storage maps#1978
Open
venk8 wants to merge 1 commit intocilium:mainfrom
Open
map: avoid misleading error message for storage maps#1978venk8 wants to merge 1 commit intocilium:mainfrom
venk8 wants to merge 1 commit intocilium:mainfrom
Conversation
Member
|
These changes seem sensible to me. It might also make sense to check the opposite, throwing an more explicit error when entries is 0 for maps that require them to be non-zero. I would squash the second commit into the first one. |
Avoid misleading error message suggesting MaxEntries may be incorrectly set to zero for map types that require it to be zero. Add tests to verify that maps that cannot have zero max entries fail with the expected error message when created with MaxEntries: 0. Add CGroupStorage and PerCPUCGroupStorage to requiresZeroMaxEntries. Signed-off-by: Venkat Krishnan <venkatkr@google.com>
Author
|
@dylandreimerink Thanks for review! I have addressed the comments. Please take a look! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR improves error handling in handleMapCreateError when creating BPF maps with zero MaxEntries.
It fixes a misleading error message when creating maps that require MaxEntries to be zero (such as SkStorage, InodeStorage, TaskStorage, CgroupStorage, CGroupStorage, and PerCPUCGroupStorage).
Previously, if map creation failed with EINVAL (e.g., due to missing BTF metadata) while MaxEntries was correctly set to 0, the error handler would wrongly suggest that MaxEntries may be incorrectly set to zero.
Changes
*Updated handleMapCreateError in map.go to exempt these map types from the MaxEntries == 0 check.