netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Julius Volz <juliusv@google.com>
Cc: davem@davemloft.net, samuel@sortiz.org, netdev@vger.kernel.org
Subject: Re: [PATCH] IRDA: Fix genlmsg_put() return value check.
Date: Tue, 24 Jun 2008 01:54:47 +0200	[thread overview]
Message-ID: <486037C7.6010409@trash.net> (raw)
In-Reply-To: <f4845fc0806231329p7ef94a8dqafe63feea89ad949@mail.gmail.com>

Julius Volz wrote:
> On Mon, Jun 23, 2008, Patrick McHardy wrote:
>> Good catch, but the correct return value for insufficient
>> space in the skb is -ENOSPC.
> 
> Hm, seems we have many inconsistent values returned in exactly this
> situation (in response to genlmsg_put), but none of them are -ENOSPC:
> 
> fs/dlm/netlink.c: -EINVAL
> net/netlink/genetlink.c: -1
> net/netlabel/netlabel_unlabeled.c: -ENOMEM
> net/netlabel/netlabel_cipso_v4.c: -ENOMEM
> net/netlabel/netlabel_mgmt.c: -ENOMEM
> net/wireless/nl80211.c: -1
> drivers/acpi/event.c: -ENOMEM
> kernel/taskstats.c: -EINVAL
> 
> Seems like -ENOMEM is most common, don't know if that means it's
> correct, though...
> 
> I was also using -ENOMEM in my Netlink code, so better convert all my
> new uses to -ENOSPC?

Yes, all those should be using ENOSPC as well. nl80211 returns
inconsistent errors currently (-1/EMSGSIZE), but doesn't propagate
them back to userspace. That should probably be fixed as well.

Actually I was wrong, its EMSGSIZE, not ENOSPC that should be
returned, its more fitting and what other netlink users do as
well.


  reply	other threads:[~2008-06-23 23:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-23 19:17 [PATCH] IRDA: Fix genlmsg_put() return value check Julius Volz
2008-06-23 19:43 ` Patrick McHardy
2008-06-23 20:13   ` samuel
2008-06-23 20:29   ` Julius Volz
2008-06-23 23:54     ` Patrick McHardy [this message]
2008-06-24  9:18       ` Julius Volz
2008-06-24  9:29     ` Julius Volz
2008-06-28  3:01       ` David Miller
2008-06-30  7:11         ` samuel

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=486037C7.6010409@trash.net \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=juliusv@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=samuel@sortiz.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).