Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4061437pxb; Wed, 13 Oct 2021 19:54:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsH58kcOITcqPq8osMwWALr14yWpaVmsXCkwDLC0XC1b/oxQ7zlGgLRXKVrcsD78hwjOFt X-Received: by 2002:a63:fb09:: with SMTP id o9mr2325397pgh.255.1634180097363; Wed, 13 Oct 2021 19:54:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634180097; cv=none; d=google.com; s=arc-20160816; b=mi1a64B1E4PLnkuQG3+aMZXh58lIGi43rEPx+m5cN7GSfbYEsHZhQGCprStmqFazm0 dQ2MheMMRqf4URLYzEt9Xz1D3B3GbVDizd/GTl//rJIxdPoZYWFWPHPnUrhLzaf6ADPP zPxFojVXbheAVGlj0I+YgiFy7ot0Gc8hfqqsLMWE9eF1yblH4c76HY8ZQE5yLpLju2kW zuTOjJkfhPplOhcTFFa5rlAF/eID67oxAOhuYIHy4ZDR2pHgrIM6y6jDiMPbNY8PhV4k XPVHhKTHujj27596YsCv/otgawdOkQXABF8jWOfS2iIX6bPm8PYBLULXkTV0XEbzaYaF /VDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=78v6ehYr8lkWAmAtl+EulYj9+9VVNSSph/rczTFZO4k=; b=RaiAA6Q1KiRXb9nwnPhMHiqp8uSy1s3gVFbCNYFLQ9JXBEkMX5vQdF0yGnVGaWnQIU jrPf34lVcwYS2oTN6OkYdsDv7qeOqMEkAt+/y5W4glQBQgRUeaoBP30XSeHo4N0Ns23C fDzGMMwmiRJL/LvQmGP9CVuAfwEI1ZJc6pYLWVznboybymuj5M8/L76RpIy0lHRrqGW+ 2CeBb9Dlb5RcSE18Om4dZVTYL0vTRYBWXuoLm6yDacmz+seoC0W6QDLDsYSbvbwHDQbp sFw/josUTLDS+ZPw6+MKOVG+8JlqgjkqmWIEUyvjP2UML8Gm/VsY5h5rLp+GuFnUCZzE B2Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Rqjvlj5l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v3si9843799pjj.135.2021.10.13.19.54.42; Wed, 13 Oct 2021 19:54:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Rqjvlj5l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S229879AbhJNCyG (ORCPT + 99 others); Wed, 13 Oct 2021 22:54:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229496AbhJNCyG (ORCPT ); Wed, 13 Oct 2021 22:54:06 -0400 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09FE2C061570; Wed, 13 Oct 2021 19:52:02 -0700 (PDT) Received: by mail-io1-xd2f.google.com with SMTP id h196so2073530iof.2; Wed, 13 Oct 2021 19:52:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=78v6ehYr8lkWAmAtl+EulYj9+9VVNSSph/rczTFZO4k=; b=Rqjvlj5lj2cg/ECXzgoojZoaDB7+XLotUnE9LIpf/a1lAX+cjfjAoFKlo2IMMeXWTK 1YjW7fp0qxXmWj6us5i13LNJgu1tUbFE5ZI4rBQ5WF3NPOc/A+5xiBgjB/F40+mqoUW4 wYeJBCoATKKhUkL0WnUNWsOChMBZWJGmsv7eSL7FV1W8W4fc9F6mcrSv8F5SYBnnnhXu kQEXu9lAwqUoYwwKUJZ81LgvnS9yjFQuCmliFPW6RiyOxNmqikPfLoZFm6kA6Xq8FMZR YbO8OtjHuNsFGAMrz01/Qa3d7NI4+WA/WFz/fv0DRwzCctiokL7JlBnjzap3IpwTD4Cv r9yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=78v6ehYr8lkWAmAtl+EulYj9+9VVNSSph/rczTFZO4k=; b=Ci7QNwLKtFC0Y8I6Yut1jHgETgz8l7XZfvk7JSuCW5ThD+wWd7WilgruwizquPERs3 X8tNTJy6pdQL7c8CYhWTX9wp63C3QydeRoAdG/zZvorncLv3tS+tUzJcsPMWtnp/0ACY dgFLwYM9vGrnXf0+LsWDRDOXYkNnMTefmHgLs6qF55jDpNApOKxUKT/1QwsqN8KiqHzn f6xLU7pYg51YLNZ9SCAy6JG70Qp1vphoJ/l1rLsHtptBvwCsVsjbEw+jIylH5FDdWo9g XHhb2DV0yUktlrRGiC/WduzK6mlFOq8LjF80vHDAcA8Hk9JtqWUvPe3Mzhy1nqPh4wJC 8+jQ== X-Gm-Message-State: AOAM530Lky4yIb13Dp7qIG40kzEd4eyXCpNtMAAHSgRCc4vKlhaG8aLJ YhaGf/VbY8IScUTkSmZNFaKKcYuk6UT1eg== X-Received: by 2002:a05:6602:2b8f:: with SMTP id r15mr431475iov.93.1634179921459; Wed, 13 Oct 2021 19:52:01 -0700 (PDT) Received: from Davids-MacBook-Pro.local ([8.48.134.40]) by smtp.googlemail.com with ESMTPSA id b4sm630370iot.45.2021.10.13.19.52.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Oct 2021 19:52:00 -0700 (PDT) Subject: Re: [PATCH] ipv4: only allow increasing fib_info_hash_size To: =?UTF-8?B?5byg5Yev?= Cc: davem@davemloft.net, yoshfuji@linux-ipv6.org, dsahern@kernel.org, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20211012110658.10166-1-zhangkaiheb@126.com> <23911752-3971-0230-cfd2-f8e30e8805db@gmail.com> <3bd88b51.6c7.17c77339c10.Coremail.zhangkaiheb@126.com> <9404e2d8-0976-1726-5f08-c277cdc14945@gmail.com> <5219d023.14d1.17c778a9a18.Coremail.zhangkaiheb@126.com> <1e3f52c3.350f.17c78afcc56.Coremail.zhangkaiheb@126.com> From: David Ahern Message-ID: Date: Wed, 13 Oct 2021 20:51:59 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <1e3f52c3.350f.17c78afcc56.Coremail.zhangkaiheb@126.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/13/21 2:05 AM, 张凯 wrote: > Should we let the function still work when the below check is true, not goto failure? > > if (new_size < fib_info_hash_size) > goto failure; > > no, it can not. if (fib_info_cnt >= fib_info_hash_size) { means the hash table is full. It is going down this path to expand. If expansion can not happen then you can not add more entries. This is all theory hence the request for a simpler change; in reality there should never be so many unique fib_info entries across namespaces to hit an overflow.