Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp2472788rwb; Sun, 6 Aug 2023 19:55:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/GjeqOdmcBcA9ABpuOpDPw4B5z9O2WASL+AW5ZR8Kui2UEtZPfJgNSloxHseYVt+g2EtO X-Received: by 2002:a05:6a20:6a28:b0:135:293b:9b14 with SMTP id p40-20020a056a206a2800b00135293b9b14mr10606559pzk.55.1691376907442; Sun, 06 Aug 2023 19:55:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691376907; cv=none; d=google.com; s=arc-20160816; b=B51JJb0nEPtIDYhFfr+zFYD4nipwG2COFHgCOP22dQW68JYeGm8QSHuJIVyFpjzDjV 9UapKG571xQhu5XlPLtb9zuRAp4sGryVxtz8Q4GX11y7R4oBHOS/hz/Rp+xCLRZil80z ZGHyq1vS/TPntHWpsmsSgjOUnNS8g1OcIxpdGKuWZTwOu7e6OI4sb6tOUGPTl5LtPC+S eWqWXl7vq1p+2DnbO8YjEWnwj2Yq3+rb+SIlcz8MctTIg5z22gg9PpLzL7+dnqVwcfde hqg5fgQE6qYwAc4BKB/m1Zpg0JFnEWXl2u6N/Jk/LXXLiNtoHCW+LhV0QTy3hPjjjv6o cz2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Xzqkz0xaGk6z113IiqwoO8SGlH2v+RBIOXZiNkod9NE=; fh=ME4nmmca4Y/XW//cD9WenxtSQYGWhuQfEv+w+PAg0WE=; b=jTUdaM7UexTw5vTwc4heKCQWBtq58bnbu7tK+zywY1HRGP68yDtVjvqeOfEUva1VKz xDkMW/zGW7tNWW5UqDsHaogEsaULTVXrjlkB3DP03736MglcJTuu9BpTFI4rPOr0h52S X7HE7Ndz6yNd8wwKC5yMSefOZHXyDJk2HDR7TyrPjk7xVrgb7ZPi9/JST30riiFkWlhu h6w7adL4uykobpyz5FQHvR/YRrQk2qAB02Opmhei92QpD58LUSEuSUEfCD2LP48VqNkg biRx/3IM71Q9mAaR/BoDmC0REE7P9P3u/t8ZJsondEyXaoFqtQcz2hJDA1PeIGC7+l5V EsBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Eh4eAqYI; 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 w67-20020a636246000000b0053f29758cd1si4976595pgb.839.2023.08.06.19.54.56; Sun, 06 Aug 2023 19:55:07 -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=20221208 header.b=Eh4eAqYI; 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 S229614AbjHGCFc (ORCPT + 99 others); Sun, 6 Aug 2023 22:05:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbjHGCFb (ORCPT ); Sun, 6 Aug 2023 22:05:31 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EA6299; Sun, 6 Aug 2023 19:05:30 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id d9443c01a7336-1bbc64f9a91so35307775ad.0; Sun, 06 Aug 2023 19:05:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691373930; x=1691978730; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Xzqkz0xaGk6z113IiqwoO8SGlH2v+RBIOXZiNkod9NE=; b=Eh4eAqYIZroph0TkppI+mL2PKdud4AgBGYmXe5oaefUeVeGzslhhP9ftc+LdUTh72R 8Y/P8FcGPKoZIFDnXsYob3GaHCzsL59VT6Puhb69RnpxCGdBIun0OGciAP9Yf/o8rAsq SYo3E+p1moZJtpeldXVxdA1+Zfm8Uey5B4GiLb38YpL8kzsdgO8s+JnWn4GkqBuPqdEn XTrE77wsTGH7QNleI0lfLDJ8rjQck0z+1a3lckXJ3d5jKU6GDecoZZCzOKQo2Sgyfe4t 6cPwnlo2E0UC8SmjO4uamH5d87fKJ2FZiVZ+GM9ZVT0ulReZ/x+JsuMR8aS5OXEe0je0 O64w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691373930; x=1691978730; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xzqkz0xaGk6z113IiqwoO8SGlH2v+RBIOXZiNkod9NE=; b=leMkd0kEgFHLKxS46I18lbs4HtyeLt9BNNvQpgBqWM6dZc3WH0gFYPJNbnFzMestM/ An2EOwieGXx3b+hUiMHz4/BcqQWTmrQEWthkEkJIeq98U2vAyG5tMs9JppriaXh/7p8/ t0BV4EYlKKida6Snx7twQZyCX21JgeBB8+NdkJ+TBSoskAqddyznunwEcMhyWeMsf1p5 xZB7gINGWI9SdT/dQO3F2MGi4jzmDMrbqP+KrmKsWGXtXse2gioY53q+Jnc0BMlFNCuk lRBkQrRnsGRhlZfRDwQFJTR7B7JrCUd2ZExx+5SG/KfW0/TVGJJ+jJyVseegjDOejGOr KD1g== X-Gm-Message-State: AOJu0YyeSWyae9iJOUEQprFYyqDhA6XT59lxRofTPrCotxmBs5R0RXII s0p56bVjshvXqrDifWC3IAc= X-Received: by 2002:a17:903:2310:b0:1bb:d048:3173 with SMTP id d16-20020a170903231000b001bbd0483173mr9530028plh.61.1691373929657; Sun, 06 Aug 2023 19:05:29 -0700 (PDT) Received: from localhost.localdomain ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id g5-20020a170902c38500b001bbd1562e75sm5482839plg.55.2023.08.06.19.05.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Aug 2023 19:05:29 -0700 (PDT) From: xu X-Google-Original-From: xu To: vadim.fedorenko@linux.dev Cc: davem@davemloft.net, dsahern@kernel.org, edumazet@google.com, kuba@kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, yang.yang29@zte.com.cn, xu.xin16@zte.com.cn, si.hao@zte.com.cn, dai.shixin@zte.com.cn Subject: Re: [PATCH] net/ipv4: return the real errno instead of -EINVAL Date: Mon, 7 Aug 2023 02:05:25 +0000 Message-Id: <20230807020525.248349-1-xu.xin16@zte.com.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <3e38a143-b683-6368-8e76-277394155bc6@linux.dev> References: <3e38a143-b683-6368-8e76-277394155bc6@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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_BLOCKED,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 >> @@ -236,7 +234,8 @@ static int ip_finish_output2(struct net *net, struct sock *sk, struct sk_buff *s >> net_dbg_ratelimited("%s: No header cache and no neighbour!\n", >> __func__); >> kfree_skb_reason(skb, SKB_DROP_REASON_NEIGH_CREATEFAIL); >> - return -EINVAL; >> + res = PTR_ERR(neigh); >> + return res; > >I believe this part could be written as > >- return -EINVAL; >+ return PTR_ERR(neigh); > > >and there is no need to change the code is other places. This will be >easier to track/backport. Sure, I initially wrote the same thing with you, but considering the convenience of maintainer review, I deliberately modified some other parts of the code to present a clear context of the core modifications. From your reply, I can see you agree with my key idea of this patch, so I have sent a v2 patch[1] according to your view. [1] https://lore.kernel.org/all/20230807015408.248237-1-xu.xin16@zte.com.cn/