OpenVZ Forum


Home » Mailing lists » Devel » [PATCH 10/12] L2 network namespace: playing with pass-through device
Re: [PATCH 10/12] L2 network namespace: playing with pass-through device [message #16963 is a reply to message #16842] Mon, 11 December 2006 15:35 Go to previous messageGo to previous message
Cedric Le Goater is currently offline  Cedric Le Goater
Messages: 443
Registered: February 2006
Senior Member
>  void free_net_ns(struct kref *kref)
>  {
>  	struct net_namespace *ns;
> +	unsigned long flags;
>  
> +	/* taking lock after atomic_dec_and_test is racy */
> +	spin_lock_irqsave(&net_ns_list_lock, flags);
>  	ns = container_of(kref, struct net_namespace, kref);
> +	if (atomic_read(&ns->kref.refcount) ||
> +	    list_empty(&ns->sibling_list)) {
> +		spin_unlock_irqrestore(&net_ns_list_lock, flags);
> +		return;

what about the cleanup ? is it skipped ?
 
> +	}
> +	list_del_init(&ns->sibling_list);
> +	spin_unlock_irqrestore(&net_ns_list_lock, flags);
> +	put_net_ns(ns->parent);
> +
>  	unregister_netdev(ns->loopback_dev_p);
>  	if (ns->dev_base_p != NULL) {
>  		printk("NET_NS: BUG: namespace %p has devices! ref %d\n",
> @@ -104,8 +128,10 @@ void free_net_ns(struct kref *kref)
>  		return;
>  	}
>  	ip_fib_struct_cleanup();
> +	printk(KERN_DEBUG "NET_NS: net namespace %p (%u) destroyed\n",
> +			ns, ns->id);
>  	kfree(ns);
>  }
> +/* because of put_net_ns() */
>  EXPORT_SYMBOL(free_net_ns);
> -
>  #endif /* CONFIG_NET_NS */
_______________________________________________
Containers mailing list
Containers@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: [PATCH 10/12] L2 network namespace: playing with pass-through device
Next Topic: Re: Re: [RFC] L3 network isolation : broadcast
Goto Forum:
  


Current Time: Sat Sep 06 20:37:43 GMT 2025

Total time taken to generate the page: 0.13161 seconds