Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2438276ybb; Fri, 27 Mar 2020 05:39:19 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvqxrvyJFiJ14QmJ8SE33nE2YUxLOE86Hj1B0zm5HB3iyL2DxG4Y2rwqWir+ERh+TbC9utQ X-Received: by 2002:a05:6830:146:: with SMTP id j6mr9996784otp.117.1585312759544; Fri, 27 Mar 2020 05:39:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585312759; cv=none; d=google.com; s=arc-20160816; b=cE4gCGjbgJoXZW9yjqT0zmegUoo8fVa7F110Gn8s8KzKvYF/MzS8qvZg+Zill/6Amv 5UzXnJVIdP4J2ZI3i5DbGR+Qe01LxTkEEDhhQbZfZlOSfUlqoWNClgqjU9Ifg40o+eZy B9ARCw7keOB7IvII6Q2loGLlYIStwe+hq1+IS1KsNLxM5/jVSeK8DDpyUU09MzhXYuJX mGkM2VSwMU/vKw1di/vUUBbW0uAn5jtV1wprNqsq3BwXRXges6IrXCzlRK14tO7xxkjH LSZbAcFVOq6sVrqjPVS+Fr3hYBhn+SwXzX1X8LAr4Cd52zcPcTGqdCp8ipst9Tyag8EG ocuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=7qDoTMtv6L9w7k7X7LetJAwhcKLNcQ7yC6K/wrZBwqg=; b=cJJ0QY+C0uT7wHTKE9dKy0DeQcg3yH6W5uACdlv3bKd7H7JD5AsTvTgChepfNjvsz+ +CtY+UjcnRCOjtI2zE9qcAr2zSeZClrbeKGw3iNIZtSWJ3AaAmIzJmJITuuAzGSUpAVa HK1jVOZD2cvmfRPctpD/FTg48L9Jl6IWoSDscbRkh2T7VDdltOrr7kS6Q7nCxiBf029g jmH/zcP9IYdYko1L16dGYiZYSVnVCKAGfyYCaF7r4zicICHjig1b5mC6o5pkpq2fTpWe knvCewE+nQ5AiYGkz1P8vpmvTVoUBs+EFGazcQcpGFMpPIDHK9qCAH7jGjvSwre0kzYx Rb3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y124si2528451oig.60.2020.03.27.05.39.06; Fri, 27 Mar 2020 05:39:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727393AbgC0Mi1 (ORCPT + 99 others); Fri, 27 Mar 2020 08:38:27 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:12201 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726540AbgC0Mi1 (ORCPT ); Fri, 27 Mar 2020 08:38:27 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 10324449DC695C7FC61B; Fri, 27 Mar 2020 20:38:16 +0800 (CST) Received: from localhost (10.173.223.234) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.487.0; Fri, 27 Mar 2020 20:38:09 +0800 From: YueHaibing To: , , , CC: , , YueHaibing Subject: [PATCH net-next] xfrm: policy: Remove obsolete WARN while xfrm policy inserting Date: Fri, 27 Mar 2020 20:34:43 +0800 Message-ID: <20200327123443.12408-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.173.223.234] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit 7cb8a93968e3 ("xfrm: Allow inserting policies with matching mark and different priorities"), we allow duplicate policies with different priority, this WARN is not needed any more. Signed-off-by: YueHaibing --- net/xfrm/xfrm_policy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index dbda08e..5c4387c 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -1508,7 +1508,7 @@ static void xfrm_policy_insert_inexact_list(struct hlist_head *chain, !selector_cmp(&pol->selector, &policy->selector) && xfrm_policy_mark_match(policy, pol) && xfrm_sec_ctx_match(pol->security, policy->security) && - !WARN_ON(delpol)) { + !delpol) { delpol = pol; if (policy->priority > pol->priority) continue; @@ -1543,7 +1543,7 @@ static struct xfrm_policy *xfrm_policy_insert_list(struct hlist_head *chain, !selector_cmp(&pol->selector, &policy->selector) && xfrm_policy_mark_match(policy, pol) && xfrm_sec_ctx_match(pol->security, policy->security) && - !WARN_ON(delpol)) { + !delpol) { if (excl) return ERR_PTR(-EEXIST); delpol = pol; -- 1.8.3.1