Re: [PROPOSED PATCH] ATM refcount

From: Francois romieu (romieu@ensta.fr)
Date: Thu Oct 19 2000 - 12:20:08 EST


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Oct 23 2000 - 21:00:15 EST