Messages in this thread | | | Date | Mon, 16 Jun 2003 20:00:33 +0200 (CEST) | From | Martin Diehl <> | Subject | Re: Flaw in the driver-model implementation of attributes |
| |
On Mon, 16 Jun 2003, Russell King wrote:
> On Mon, Jun 16, 2003 at 10:08:26AM -0700, Greg KH wrote: > > Then don't let your module unload until _all_ instances of your > > structures are gone. You can tell if this is true or not, it's just up > > to the implementor :) > > Greg, I believe Alan does have a valid concern. Eg, how is the following > handled? > > - PCI device driver module is loaded > - device driver gets handed a pci device > - device driver attaches a file to the struct device corresponding to the > PCI device.
with old procfs one would like to set the owner field of the corresponding struct proc_dir_entry and/or file_operations at this point.
> - userspace opens new file (this does not increment the device drivers > use count.)
given owner=THIS_MODULE was set, this would bump the module's use count
> - device driver is rmmod'd
and this could never happen while the procfs file (or directory) is still referenced
> - device driver removes its references to the pci device > - device driver unloads > - user reads from opened file.
Admittedly I haven't looked deeper into sysfs yet, but I was under the assumption/hope there would be a similar approach to make module refcounting working there?
Martin
- 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/
| |