Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp260092rwi; Wed, 26 Oct 2022 00:03:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6rJMUAdKQoznIlqEoVwCr0P5xksXIQwbINa4pYnTI3FzuvaB30bHdsleUC+1bm1/fueVnK X-Received: by 2002:a05:6402:4444:b0:458:f355:ce04 with SMTP id o4-20020a056402444400b00458f355ce04mr39953004edb.422.1666767806386; Wed, 26 Oct 2022 00:03:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666767806; cv=none; d=google.com; s=arc-20160816; b=poAJChgyMzG2znPoxg1MHo0D8BVZ9Do2SIdlG0wzt29wU6dksOcu6QrqRGhWq4w/qK s6mU96kAsrek7mxbPptCaXAsyhnlEgVlcSVDU+ViE38Qhayo8Pma8jF4alkJN+j2Z2J+ KbppJ96b0uDAk3Fb6kqK4swqzGqFMDjPMGFL4+nIgjfakA2z8Y+f9xjhuWSbhLB8U4EC x2KJ33n6+tHhBuSLmLlso4NxKYADuI6TzuuzyCu9WcUESzT/iAuoWM0X7T6Qq6nE62Jz Trjn+qzui8R5k14L4SBR+f8K56mZw64msDfSef8O123A2fUeZbWS7aYkayB9SQK4X7D0 xFKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=mF6zW9SFm7uxaco2K2CDLfIGBcOnQunLUbLBgwIgUhQ=; b=OkoWZYNgDTclyjZPJjG/ZKpoh5sU/cpm+DxEQFKmfDMZgd7sMR7KOdRYQkRj2iZtfK lyk8KZKhwX2FYT7UCJBmTpsxf+EQyq+CB+JsPf6p7bjLEn0z7xjPE1yzXfYswqEoVZqA DDUwgnWFuJaWhRBvNy7hGowhQbOMNZQSZaKVl0J7DA5s0XeKxBBYMvikywTP6XtMVBRY gIycbzWM1arh3fQRizyMKlLw7pddqDjvW2eF/ZFYeljgXW0rmcd4wp8MmrfrU0LKhy3c GihXazNORvbuuiUlnMY/w7tqsZ2W61rNsXC8lOL9g2zTMXCeZY+AqfzX0j4syMYPKUbm RNjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Mm1POrX6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l21-20020a170906795500b007836227b96fsi5046833ejo.888.2022.10.26.00.02.48; Wed, 26 Oct 2022 00:03:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Mm1POrX6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233145AbiJZGda (ORCPT + 99 others); Wed, 26 Oct 2022 02:33:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233094AbiJZGdJ (ORCPT ); Wed, 26 Oct 2022 02:33:09 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FD9EA99E6; Tue, 25 Oct 2022 23:33:08 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id kt23so13116646ejc.7; Tue, 25 Oct 2022 23:33:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=mF6zW9SFm7uxaco2K2CDLfIGBcOnQunLUbLBgwIgUhQ=; b=Mm1POrX6xfBCMRhZT8ReywaZqeVagLYUSYmV51+7FJE1cm8Zx9McyYfiGKFnfn6fUz dfzUlLnVrsB4zqU0NAuFQ8udQ4ALm1QDYbTAm0odL18FxEi/FR028ecb5YKs/PfebjiO 8P59bm7H327h6mNW0I9O319E9RIKIT8URtSbQcA8H17PLcP20gIztMvafyPrKx8A1qGE ccj383RGlmumOV2u7xoEH1iNQyjyYcZC5vbVEhI2NLrsyhHRtpDo2EQBl9Fbsqm+KDhe c3Fa8uBIuEEzq+m6O+MMfxRRz8dcQ5X57C4EVQ4Qo/5H7GHsNSQwAE0tF/b/4l3B6xzu fs1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mF6zW9SFm7uxaco2K2CDLfIGBcOnQunLUbLBgwIgUhQ=; b=IMsHhkAaN9EJWfbHCIyBVejXiWTQVUjS3H7UBp7nImKxnYRli569A9ZMMikYKqYVRk b9J02hM/yVAXkqnPU9QqC8emz01VLxh5J/rWMZkg87Xlt/MHhnZeNA+1KgaC3+Uoktqs eg63B/gmi4jQL6L1DMDvpnvcVX2jMAy1FLVIaFDcfJK1KYiWA7hX3BC0KW1US6l026Vs mJxdEZ3Ixbv+8XhnRyctHCiy4g3vKqd829jgZmdjrHt4oAIlKvrMxcXSa5WZ9RFEzUrG iZpzi7Y0AzOogAlxxptaU9P7/xe1rFhKdcT59hI6vgOf4NwQXKOP2J8jPukla8Z9Ci3h s5hg== X-Gm-Message-State: ACrzQf3rknddlG4n+IOeyyevXP5zRas0oldCZ1+38lfFh5HqEu58mM6X R4nk8+gsq+2FcnNwZtOz9wc0m3TVzOZnujrLI9w= X-Received: by 2002:a17:907:7b94:b0:731:1b11:c241 with SMTP id ne20-20020a1709077b9400b007311b11c241mr36870991ejc.676.1666765986787; Tue, 25 Oct 2022 23:33:06 -0700 (PDT) MIME-Version: 1.0 References: <20221026025941.2621795-1-xukuohai@huaweicloud.com> In-Reply-To: <20221026025941.2621795-1-xukuohai@huaweicloud.com> From: Alexei Starovoitov Date: Tue, 25 Oct 2022 23:32:55 -0700 Message-ID: Subject: Re: [PATCH bpf-next] bpf: Fix a typo in comment for DFS algorithm To: Xu Kuohai Cc: bpf , LKML , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , "David S . Miller" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 25, 2022 at 7:42 PM Xu Kuohai wrote: > > From: Xu Kuohai > > There is a typo in comment for DFS algorithm in bpf/verifier.c. The top > element should not be popped until all its neighbors have been checked. > Fix it. > > Fixes: 475fb78fbf48 ("bpf: verifier (add branch/goto checks)") > Signed-off-by: Xu Kuohai > --- > kernel/bpf/verifier.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c > index b83a8d420520..96ba5ea6d1a6 100644 > --- a/kernel/bpf/verifier.c > +++ b/kernel/bpf/verifier.c > @@ -10662,7 +10662,7 @@ static int check_return_code(struct bpf_verifier_env *env) > * 3 let S be a stack > * 4 S.push(v) > * 5 while S is not empty > - * 6 t <- S.pop() > + * 6 t <- S.top() Even with this fix the comment is not quite accurate. I wonder whether we should keep it or delete it completely. At least please use 'peek' instead of 'top'.