public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Nicolas Dichtel <nicolas.dichtel@6wind•com>
To: Dan Carpenter <dan.carpenter@oracle•com>
Cc: kernel-janitors@vger•kernel.org, netdev <netdev@vger•kernel.org>
Subject: Re: netns: use a spin_lock to protect nsid management
Date: Wed, 13 May 2015 13:37:21 +0200	[thread overview]
Message-ID: <55533771.6080406@6wind.com> (raw)
In-Reply-To: <20150512175227.GA19020@mwanda>

Le 12/05/2015 19:52, Dan Carpenter a écrit :
> Hello Nicolas Dichtel,
>
> The patch 95f38411df05: "netns: use a spin_lock to protect nsid
> management" from May 7, 2015, leads to the following static checker
> warning:
>
> 	net/core/net_namespace.c:580 rtnl_net_newid()
> 	warn: inconsistent returns 'spin_lock:&nsid_lock'.
>
> net/core/net_namespace.c
>     565
>     566          spin_lock_irqsave(&nsid_lock, flags);
>     567          if (__peernet2id(net, peer) >= 0) {
>     568                  err = -EEXIST;
>     569                  goto out;
>
> I don't know if __peernet2id() unlocks on error but it can't possibly
> restore flags so this isn't right.
It's a bug. I will send a patch.

Thank you for the report.

Nicolas

  parent reply	other threads:[~2015-05-13 11:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20150512175227.GA19020@mwanda>
2015-05-12 19:16 ` netns: use a spin_lock to protect nsid management Cong Wang
2015-05-13 11:58   ` Nicolas Dichtel
2015-05-13 11:37 ` Nicolas Dichtel [this message]
2015-05-13 11:43   ` [PATCH net-next] netns: fix unbalanced spin_lock on error Nicolas Dichtel
2015-05-15  2:36     ` 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=55533771.6080406@6wind.com \
    --to=nicolas.dichtel@6wind$(echo .)com \
    --cc=dan.carpenter@oracle$(echo .)com \
    --cc=kernel-janitors@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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