From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751335AbdKMADT (ORCPT ); Sun, 12 Nov 2017 19:03:19 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:51010 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750985AbdKMADR (ORCPT ); Sun, 12 Nov 2017 19:03:17 -0500 X-Google-Smtp-Source: AGs4zMZzdsPBmkx8RnaoK3IlaJdOlDZQC4a+Kr2jSkJjhtTkw6SSAF2PIXnLMhdkhSu5bkS7L4qE5g== Date: Sun, 12 Nov 2017 16:03:15 -0800 From: Stephen Hemminger To: Rasmus Villemoes Cc: "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/7] net: core: maybe return -EEXIST in __dev_alloc_name Message-ID: <20171112160315.5e7e5596@xeon-e3> In-Reply-To: <20171112231511.4666-7-linux@rasmusvillemoes.dk> References: <20171112231511.4666-1-linux@rasmusvillemoes.dk> <20171112231511.4666-7-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 13 Nov 2017 00:15:09 +0100 Rasmus Villemoes wrote: > If we're given format string with no %d, -EEXIST is a saner error code. > > Signed-off-by: Rasmus Villemoes > --- > net/core/dev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/core/dev.c b/net/core/dev.c > index c0a92cf27566..7c08b4ca7b76 100644 > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -1104,7 +1104,7 @@ static int __dev_alloc_name(struct net *net, const char *name, char *buf) > * when the name is long and there isn't enough space left > * for the digits, or if all bits are used. > */ > - return -ENFILE; > + return p ? -ENFILE : -EEXIST; > } > > static int dev_alloc_name_ns(struct net *net, This is potentially a change to user ABI with no real advantage.