From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 74CAA208C2 for ; Fri, 20 Oct 2023 19:04:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="F8FO8PL3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B41AEC433C7; Fri, 20 Oct 2023 19:04:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697828678; bh=LCXmArATLRdEdMhrP5wy5aw0KH7d4QFffhPe4PUzoNQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=F8FO8PL381Q2eyz9tIjDV+u+8FLcqaI13wAjd0Mg84Cu0Jk/MJhVSjeKu9yw9muAZ LWtewS/H8ptRf7I3hbcUd7yuku2hUtPN3Fz6LKzEH2u9SXHZDVMF61Rlq+494nFGHe T7jrphph4iaUIWYP5uXHzL2FPtXBU6kLs/4WjKqw5vuYXh5Rbb/tKPxwMq/KLadv+O BBhrwylnS4tuHJ/C7x0xjLg4/ZHrJweyreinL9XytmUzTgQX2rFN/W6k9+tMMUHy6w V8tfCUTc6Snop5h2r2iLDdkNQEtKktOrv0bmQT7xbWMHEJSWB1YrQbOvE0K7u8mLJP fN7HLeyEp10JA== Date: Fri, 20 Oct 2023 12:04:36 -0700 From: Jakub Kicinski To: Jiri Pirko Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com, johannes.berg@intel.com, mpe@ellerman.id.au, j@w1.fi Subject: Re: [PATCH net-next 4/6] net: trust the bitmap in __dev_alloc_name() Message-ID: <20231020120436.7fbed61c@kernel.org> In-Reply-To: References: <20231020011856.3244410-1-kuba@kernel.org> <20231020011856.3244410-5-kuba@kernel.org> 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-Transfer-Encoding: 7bit On Fri, 20 Oct 2023 12:38:31 +0200 Jiri Pirko wrote: > >+ if (i == max_netdevices) > >+ return -ENFILE; > > Hmm, aren't you changeing functionality here? I mean, prior to this > patch, the i of value "max_netdevices" was happily used, wan't it? > In theory it may break things allowing n-1 netdevices of a name instead > of n. Good point, I should add that to the commit message. But we don't care, right? Nobody is asking to increase the limit, feel like chances that someone will care about 32k vs 32k - 1 devices are extremely low.