Re: [PATCH][ATM] add reference counting to atm_dev

From: chas williams (chas@locutus.cmf.nrl.navy.mil)
Date: Fri May 16 2003 - 10:39:21 EST


In message <200305161640.43804.baldrick@wanadoo.fr>,Duncan Sands writes:
>I was wondering about ioctl and proc calls. Can the ATM layer call
>a driver's ioctl routine before opening a vcc? If so, does it take a

yes

>reference to the module first (I didn't spot anything)? Also, are

the original atm code used atm_dev_lock to keep the device from
disappearing during the ioctl. atm_dev_lock was being used to protect
sections of code, like ioctl and atm device (de)registry. the 2.5
code is getting changes that should improve matters. atm_dev will
now have a reference count to keep a device from being unregistered
while someone holds a reference (ioctl or otherwise).

>calls to a driver's proc_read routine protected against module
>unloading races (I confess I didn't take the time to look into this,
>because my own driver does not sleep in proc_read)?

i believe proc has always been a troublesome child. it has never
had any protection (via atm_dev_lock or otherwise). you can sleep
in the proc function (since it would in user mode). i have added some
locking to proc in the 2.5 that should make proc safer (but not very
elegant--perhaps elegance with come with the seq conversion).
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri May 23 2003 - 22:00:24 EST