> > > A full webrev against onnv:
> > > http://cr.opensolaris.org/~seb/dladm-privs.2/
> > >
> > > An incremental webrev against the first webrev:
> > > http://cr.opensolaris.org/~seb/dladm-privs.2.inc/
> Yes, "driver instance" is implied since there's only one instance, and
> thus all state is driver-global. There's also this bit of weirdness in
> the original _fini():
>
> 162 int
> 163 _fini(void)
> 164 {
> 165 int err;
> 166
> 167 if ((err = mod_remove(&drv_modlinkage)) != 0)
> 168 return (err);
> 169
> 170 if (drv_fini() != 0) {
> 171 (void) mod_install(&drv_modlinkage);
> 172 return (DDI_FAILURE);
> 173 }
> 174
> 175 return (err);
> 176 }
>
> This is wrong. One should only return EBUSY prior to calling
> mod_remove(), and only teardown global resources after calling
> mod_remove(). In other words, you do things that can fail before
> mod_remove(), and things that can't fail after_mod_remove() (because
> mod_install() can actually fail above, then where are you?). As such
> the fix is either to dissect drv_fini() into pieces that can be called
> before and after mod_remove(), or simply attempt the teardown in the
> global instance detach(). The latter is simpler IMO.
I see. FWIW, line 172 is also wrong: _fini() returns errnos, not
DDI_* constants.
--
meem
_______________________________________________
networking-discuss mailing list
[email protected]