cvs commit: src/sys/dev/an if_an.c src/sys/dev/arl if_arl_isa.c src/sys/dev/awi if_awi_pccard.c src/sys/dev/cm if_cm_isa.c src/sys/dev/cnw if_cnw.c src/sys/dev/cp if_cp.c src/sys/dev/cs if_cs.c src/sys/dev/ed if_ed.c src/sys/dev/em if_em.c ...

Ruslan Ermilov ru at FreeBSD.org
Wed Sep 21 12:23:46 PDT 2005


On Wed, Sep 21, 2005 at 02:55:57PM -0400, John Baldwin wrote:
[...]
> > 3.  Fix all drivers to check IFF_DRV_RUNNING in foo_start() and exit
> >     if it's unset.  This should fix another half of shutdown panics,
> >     e.g. the one demonstrated by glebius@ in recent if_em.c commit.
> >
> > 4.  Remove IFF_DRV_RUNNING check from ether_output().
> >
> > 5.  Fix all drivers to set some flag in foo_detach() and foo_shutdown()
> >     and refuse to work in foo_ioctl() if it's set.  This should fix
> >     panics when BPF listener is attached while interface goes away or
> >     module is unloaded.
> >
> > Relevant PRs: kern/85005, kern/62889.
> >
> > Attached is a demo patch for rl(4) that does all of the above
> > except #4.
> 
> I think you can leave #4 in if the race doesn't hurt anything.  3) already 
> handles the condition you are worried about.  I'd rather 5) be simpler in 
> that it only check in the flags case to not force the driver lock to be 
> acquired for all the ioctls that the driver doesn't actually handle.  
> Actually, I think I'd really prefer that we think about how to fix the BPF 
> issue in BPF itself if possible.  It may be that we don't need to set the 
> flags (i.e. skip the actual ioctl) if the interface is in the process of 
> detaching and we can make that change centrally without having to scatter 
> gone flags in all the drivers.
> 
BPF is just one (known) problem, but we'd like to fix it once and for
all, "ifconfig during detach" Warner mentioned is just another one.
I'd very much like some generic solution that doesn't involve adding
this check to every foo_ioctl(), but I have no idea at the moment.


Cheers,
-- 
Ruslan Ermilov
ru at FreeBSD.org
FreeBSD committer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20050921/811c2bda/attachment.bin


More information about the cvs-src mailing list