[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-atm
Subject:    Re: [PROPOSED PATCH] ATM refcount
From:       Francois romieu <romieu () ensta ! fr>
Date:       2000-10-19 15:18:53
[Download RAW message or body]

Hi, 

1 - couldn't there be a problem through :
atm_release/svc_release -> atm_release_vcc_sk (...vcc->dev->ops->close) -> 
sigd_close -> *atm_devs walk* 

2 - 
> --- linux-2.4.0-test10-pre4.clean/net/atm/common.c	Wed Jul 12 12:26:08 2000
> +++ linux-2.4.0-test10-pre4.fs50/net/atm/common.c	Thu Oct 19 14:42:11 2000
[...]
> @@ -252,13 +256,26 @@
>  static int atm_do_connect(struct atm_vcc *vcc,int itf,int vpi,int vci)
>  {
>  	struct atm_dev *dev;
> +	int return_val;
>  
> +	printk ("lock %s\n", __FUNCTION__);
> +	spin_lock (&atm_dev_lock);
> +	printk ("Before find device\n");
>  	dev = atm_find_dev(itf);
> -	if (!dev) return -ENODEV;
> -	return atm_do_connect_dev(vcc,dev,vpi,vci);
> +	printk ("After find device\n");
> +	if (!dev){
> +		 spin_unlock (&atm_dev_lock);
> +		 printk ("spin unlock\n");
> +		 return -ENODEV;
> +	}
> +	return_val = atm_do_connect_dev(vcc,dev,vpi,vci);
> +	spin_unlock (&atm_dev_lock);

	if (!dev) {
		return_val = -ENODEV;
		goto done;
	}
	return_val = atm_do_connect_dev(vcc,dev,vpi,vci);
done:
	spin_unlock (&atm_dev_lock);
	return return_val;

3 - I haven't seen where bind_vcc may be protected btw:
    186     if (dev) {
    187         vcc->next = NULL;
    188         vcc->prev = dev->last;
    189         if (dev->vccs) dev->last->next = vcc;
    190         else dev->vccs = vcc;
    191         dev->last = vcc;

A       B
                vcc->next = NULL
...
191             dev->last = vcc
...     189     dev->last->next = vcc
-> vcc->next = vcc ?

-- 
Ueimor

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic