On 3/4/21 7:11 AM, Tal Lossos wrote:
Hi, For some reason I've noticed that the current inode_storage's lookup_elem func returns NULL for a bad fd, which causes ENOENT in bpf_map_copy_value. This behaviour is different from the other inode_storage's functions like update_elem which returns EBADF for a bad fd. We've checked in the other local storage maps (tasks and sock) and they return EBADF for a bad fd in their lookup_elem func. Should inode_storage's lookup_elem func be changed for this same behaviour? I could submit a patch which changes that behaviour.
Yes, -EBADF is better than -ENOENT. Please go ahead to submit a patch. Thanks!
Thanks.