]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sAdd a comment indicating why there continues to be a race condition in
authorrwatson <rwatson@FreeBSD.org>
Thu, 18 Mar 2004 09:55:11 +0000 (09:55 +0000)
committerrwatson <rwatson@FreeBSD.org>
Thu, 18 Mar 2004 09:55:11 +0000 (09:55 +0000)
commit54eb0efc5356f41cbc74b87331bf4cdb339f5d3e
tree202f617bdd7c7deac528f79b343601786ef2b14c
parentdf09012184a8ffa4f548e23f416794105f9707d3
sAdd a comment indicating why there continues to be a race condition in
the tap driver, even with Giant over the cdev operation vector, due to
a non-atomic test-and-set of the si_drv1 field in the dev_t.  This bug
exists with Giant under high memory pressure, as malloc() may sleep
in tapcreate(), but is less likely to occur.  The resolution will
probably be to cover si_drv1 using the global tapmtx since no softc is
available, but I need to think about this problem more generally
across a range of drivers using si_drv1 in combination with SI_CHEAPCLONE
to defer expensive allocation to open().

Correct what appears to be a bug in the original if_tap implementation,
in which tapopen() will panic if a tap device instance is opened more
than once due to an incorrect assertion -- only triggered if INVARIANTS
is compiled in (i.e., when built into a kernel).  Return EBUSY instead.

Expand mtx_lock() coverage using tp->tap_mtx to include tp->ether_addr.
sys/net/if_tap.c