From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84B35C433DB for ; Mon, 8 Mar 2021 15:08:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5F2A065222 for ; Mon, 8 Mar 2021 15:08:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230231AbhCHPIP (ORCPT ); Mon, 8 Mar 2021 10:08:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:52350 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231512AbhCHPIA (ORCPT ); Mon, 8 Mar 2021 10:08:00 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0EFF865226 for ; Mon, 8 Mar 2021 15:08:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615216080; bh=B2SN6dS0d3ZxUpftniIQxNdiS6RVkIDFFBhIgVMgdn8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=sPM2gYQZ83cv8nxhGfiWEPqD2qqUrTf7q3Eawl7QeJhDce99ndrq4Ld9b3SBb2x1k qy8rx7HlbVyD5miXRBwabHpuC1mqXbSSNrwBcHI1ZBB5eUCBZG26H7iJZnXCP2FqM0 a9LTlZ1Ph3eb2n7LK9lkc4Xr75pyYnj7Fc3lwDV4LjtlSfvuXXabaYF+8d9ZR3lauX Q8+XVDjIGn8jv+5SMtLCxNaMo5Ij6Qh00Kwv8Y/pMLtgvQWecX63YMHtjDIqTS2VJz IY5K9DZLndEOhra9logzM1mtvIZHmv922du/AG9H3/K0ogOvQCNF0ewoAbjOCZoabi lbZPN+/BRqGfw== Received: by mail-lj1-f169.google.com with SMTP id 2so16504414ljr.5 for ; Mon, 08 Mar 2021 07:07:59 -0800 (PST) X-Gm-Message-State: AOAM530TxM7FxPgQzQbj6jdn4foZWdv6+KDGSSPxqkvoCcg6nRB8dtkd 5DZvccRhzVd56BfLeqMvcEK54X8bMhQXUy9Zp28apA== X-Google-Smtp-Source: ABdhPJzjl1YoA9XJrc8L4I1XKpwzXfdjhFB5QjpC+E3GbcP5ra+7h5x8dvRbdmxai4qikV5NrEOBTT04a+UOb/pTDvA= X-Received: by 2002:a05:651c:387:: with SMTP id e7mr14334269ljp.425.1615216078427; Mon, 08 Mar 2021 07:07:58 -0800 (PST) MIME-Version: 1.0 References: <20210307120948.61414-1-tallossos@gmail.com> In-Reply-To: From: KP Singh Date: Mon, 8 Mar 2021 16:07:47 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH bpf-next v2] bpf: Change inode_storage's lookup_elem return value from NULL to -EBADF. To: Yonghong Song Cc: Tal Lossos , bpf , Gilad Reti Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Sun, Mar 7, 2021 at 7:18 PM Yonghong Song wrote: > > > > On 3/7/21 4:09 AM, Tal Lossos wrote: > > bpf_fd_inode_storage_lookup_elem returned NULL when getting a bad FD, > > which caused -ENOENT in bpf_map_copy_value. > > EBADF is better than ENOENT for a bad FD behaviour. > > > > The patch was partially contributed by CyberArk Software, Inc. > > > > Signed-off-by: Tal Lossos > > Acked-by: Yonghong Song Thanks this makes sense and is consistent with sk_storage (which uses sockfd_lookup) and task_storage (which uses pidfd_get_pid) which return an -EBADF as well. Acked-by: KP Singh