1. 23 10月, 2016 1 次提交
  2. 24 9月, 2016 1 次提交
    • A
      netns: move {inc,dec}_net_namespaces into #ifdef · 2ed6afde
      Arnd Bergmann 提交于
      With the newly enforced limit on the number of namespaces,
      we get a build warning if CONFIG_NETNS is disabled:
      
      net/core/net_namespace.c:273:13: error: 'dec_net_namespaces' defined but not used [-Werror=unused-function]
      net/core/net_namespace.c:268:24: error: 'inc_net_namespaces' defined but not used [-Werror=unused-function]
      
      This moves the two added functions inside the #ifdef that guards
      their callers.
      
      Fixes: 70328660 ("netns: Add a limit on the number of net namespaces")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      2ed6afde
  3. 23 9月, 2016 2 次提交
  4. 05 9月, 2016 2 次提交
  5. 02 9月, 2016 1 次提交
  6. 15 8月, 2016 1 次提交
    • D
      netns: do not call pernet ops for not yet set up init_net namespace · f8c46cb3
      Dmitry Torokhov 提交于
      When CONFIG_NET_NS is disabled, registering pernet operations causes
      init() to be called immediately with init_net as an argument. Unfortunately
      this leads to some pernet ops, such as proc_net_ns_init() to be called too
      early, when init_net namespace has not been fully initialized. This causes
      issues when we want to change pernet ops to use more data from the net
      namespace in question, for example reference user namespace that owns our
      network namespace.
      
      To fix this we could either play game of musical chairs and rearrange init
      order, or we could do the same as when CONFIG_NET_NS is enabled, and
      postpone calling pernet ops->init() until namespace is set up properly.
      
      Note that we can not simply undo commit ed160e83 ("[NET]: Cleanup
      pernet operation without CONFIG_NET_NS") and use the same implementations
      for __register_pernet_operations() and __unregister_pernet_operations(),
      because many pernet ops are marked as __net_initdata and will be discarded,
      which wreaks havoc on our ops lists. Here we rely on the fact that we only
      use lists until init_net is fully initialized, which happens much earlier
      than discarding __net_initdata sections.
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f8c46cb3
  7. 09 8月, 2016 1 次提交
  8. 18 5月, 2015 1 次提交
  9. 15 5月, 2015 1 次提交
  10. 13 5月, 2015 1 次提交
  11. 10 5月, 2015 6 次提交
  12. 17 4月, 2015 1 次提交
  13. 08 4月, 2015 3 次提交
  14. 04 4月, 2015 2 次提交
  15. 30 3月, 2015 1 次提交
    • N
      netns: don't clear nsid too early on removal · 4217291e
      Nicolas Dichtel 提交于
      With the current code, ids are removed too early.
      Suppose you have an ipip interface that stands in the netns foo and its link
      part in the netns bar (so the netns bar has an nsid into the netns foo).
      Now, you remove the netns bar:
       - the bar nsid into the netns foo is removed
       - the netns exit method of ipip is called, thus our ipip iface is removed:
         => a netlink message is sent in the netns foo to advertise this deletion
         => this netlink message requests an nsid for bar, thus a new nsid is
            allocated for bar and never removed.
      
      We must remove nsids when we are sure that nobody will refer to netns currently
      cleaned.
      
      Fixes: 0c7aecd4 ("netns: add rtnl cmd to add and get peer netns ids")
      Signed-off-by: NNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4217291e
  16. 13 3月, 2015 1 次提交
  17. 24 1月, 2015 1 次提交
  18. 23 1月, 2015 1 次提交
  19. 20 1月, 2015 1 次提交
  20. 05 12月, 2014 6 次提交
  21. 10 9月, 2014 1 次提交
  22. 30 7月, 2014 1 次提交
    • E
      namespaces: Use task_lock and not rcu to protect nsproxy · 728dba3a
      Eric W. Biederman 提交于
      The synchronous syncrhonize_rcu in switch_task_namespaces makes setns
      a sufficiently expensive system call that people have complained.
      
      Upon inspect nsproxy no longer needs rcu protection for remote reads.
      remote reads are rare.  So optimize for same process reads and write
      by switching using rask_lock instead.
      
      This yields a simpler to understand lock, and a faster setns system call.
      
      In particular this fixes a performance regression observed
      by Rafael David Tinoco <rafael.tinoco@canonical.com>.
      
      This is effectively a revert of Pavel Emelyanov's commit
      cf7b708c Make access to task's nsproxy lighter
      from 2007.  The race this originialy fixed no longer exists as
      do_notify_parent uses task_active_pid_ns(parent) instead of
      parent->nsproxy.
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      728dba3a
  23. 16 5月, 2014 1 次提交
  24. 27 4月, 2014 1 次提交
  25. 31 8月, 2013 1 次提交