All of lore.kernel.org
 help / color / mirror / Atom feed
* re: netns: use a spin_lock to protect nsid management
@ 2015-05-12 17:52 Dan Carpenter
  2015-05-12 19:16   ` Cong Wang
  2015-05-13 11:37   ` Nicolas Dichtel
  0 siblings, 2 replies; 11+ messages in thread
From: Dan Carpenter @ 2015-05-12 17:52 UTC (permalink / raw)
  To: kernel-janitors

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.

   570          }
   571  
   572          err = alloc_netid(net, peer, nsid);
   573          spin_unlock_irqrestore(&nsid_lock, flags);
   574          if (err >= 0) {
   575                  rtnl_net_notifyid(net, RTM_NEWNSID, err);
   576                  err = 0;
   577          }
   578  out:
   579          put_net(peer);
   580          return err;
   581  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-05-15  2:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-12 17:52 netns: use a spin_lock to protect nsid management Dan Carpenter
2015-05-12 19:16 ` Cong Wang
2015-05-12 19:16   ` Cong Wang
2015-05-13 11:58   ` Nicolas Dichtel
2015-05-13 11:58     ` Nicolas Dichtel
2015-05-13 11:37 ` Nicolas Dichtel
2015-05-13 11:37   ` Nicolas Dichtel
2015-05-13 11:43   ` [PATCH net-next] netns: fix unbalanced spin_lock on error Nicolas Dichtel
2015-05-13 11:43     ` Nicolas Dichtel
2015-05-15  2:36     ` David Miller
2015-05-15  2:36       ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.