Since devclass_find_internal looks at and modifies the devclass
structures, it needs to hold the topo lock when called.
Sponsored by: Netflix
Differential D53451
newbus: Ensure that we hold topo lock for calls to devclass_find_internal Authored by imp on Wed, Oct 29, 6:08 PM. Tags None Referenced Files
Subscribers
Details
Diff Detail
Event TimelineComment Actions
But presumably the callers of devclass_create() and devclass_find() are doing so as well, since those functions return a devclass pointer. It looks like devclasses are never freed, so I think it's ok to lock devclass_find() and devclass_create() this way, but other devclass accessors need to be externally locked. For instance, you can't really apply this approach to devclass_get_devices(), since it returns objects that are protected only by the topo lock. I'd change the message to note that the devclass list is the main thing being synchronized here. |