From: Stephen Hemminger <stephen@networkplumber.org>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: "David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/7] net: core: maybe return -EEXIST in __dev_alloc_name
Date: Sun, 12 Nov 2017 16:03:15 -0800 [thread overview]
Message-ID: <20171112160315.5e7e5596@xeon-e3> (raw)
In-Reply-To: <20171112231511.4666-7-linux@rasmusvillemoes.dk>
On Mon, 13 Nov 2017 00:15:09 +0100
Rasmus Villemoes <linux@rasmusvillemoes.dk> wrote:
> If we're given format string with no %d, -EEXIST is a saner error code.
>
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> ---
> 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.
next prev parent reply other threads:[~2017-11-13 0:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-12 23:15 [PATCH 0/7] net: core: devname allocation cleanups Rasmus Villemoes
2017-11-12 23:15 ` [PATCH 1/7] net: core: improve sanity checking in __dev_alloc_name Rasmus Villemoes
2017-11-12 23:15 ` [PATCH 2/7] net: core: move dev_alloc_name_ns a little higher Rasmus Villemoes
2017-11-12 23:15 ` [PATCH 3/7] net: core: eliminate dev_alloc_name{,_ns} code duplication Rasmus Villemoes
2017-11-20 14:26 ` David Laight
2017-11-12 23:15 ` [PATCH 4/7] net: core: drop pointless check in __dev_alloc_name Rasmus Villemoes
2017-11-12 23:15 ` [PATCH 5/7] net: core: check dev_valid_name " Rasmus Villemoes
2017-11-12 23:15 ` [PATCH 6/7] net: core: maybe return -EEXIST " Rasmus Villemoes
2017-11-13 0:03 ` Stephen Hemminger [this message]
2017-11-12 23:15 ` [PATCH 7/7] net: core: dev_get_valid_name is now the same as dev_alloc_name_ns Rasmus Villemoes
2017-11-13 0:12 ` [PATCH 0/7] net: core: devname allocation cleanups Stephen Hemminger
2017-11-14 7:39 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171112160315.5e7e5596@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).