Skip to content

Commit

Permalink
map: remove misleading error message when creating without BTF
Browse files Browse the repository at this point in the history
Time and time again people misunderstand errors like the following:

    map create: cannot allocate memory (without BTF k/v)

Instead of focusing on the ENOMEM they assume that it has something
to do with BTF. In reality it just means that creating a map has
failed, and we didn't supply any BTF during creation.

Avoid this confusion by removing the "without BTF k/v" part.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
  • Loading branch information
lmb committed Jul 23, 2024
1 parent b689d28 commit 061e86d
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions map.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,6 @@ func handleMapCreateError(attr sys.MapCreateAttr, spec *MapSpec, err error) erro
return fmt.Errorf("map create: %w (ring map size %d not a multiple of page size %d)", err, maxEntries, pageSize)
}
}
if attr.BtfFd == 0 {
return fmt.Errorf("map create: %w (without BTF k/v)", err)
}

return fmt.Errorf("map create: %w", err)
}
Expand Down

0 comments on commit 061e86d

Please sign in to comment.