Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D428D3207 for ; Tue, 15 Aug 2023 06:05:31 +0000 (UTC) Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:237:300::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE5C01FCE; Mon, 14 Aug 2023 23:05:11 -0700 (PDT) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1qVnAk-0003Qz-9Z; Tue, 15 Aug 2023 08:04:54 +0200 Date: Tue, 15 Aug 2023 08:04:54 +0200 From: Florian Westphal To: Leon Romanovsky Cc: Dong Chenchen , steffen.klassert@secunet.com, herbert@gondor.apana.org.au, davem@davemloft.net, fw@strlen.de, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, timo.teras@iki.fi, yuehaibing@huawei.com, weiyongjun1@huawei.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [Patch net, v2] net: xfrm: skip policies marked as dead while reinserting policies Message-ID: <20230815060454.GA2833@breakpoint.cc> References: <20230814140013.712001-1-dongchenchen2@huawei.com> <20230815060026.GE22185@unreal> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230815060026.GE22185@unreal> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,T_SPF_TEMPERROR autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Leon Romanovsky wrote: > > dir = xfrm_policy_id2dir(policy->index); > > - if (policy->walk.dead || dir >= XFRM_POLICY_MAX) > > + if (dir >= XFRM_POLICY_MAX) > > This change is unnecessary, previous code was perfectly fine. Are you sure? AFAICS walker struct has no 'index' member.