cvs commit: src/sys/net if_tap.c

Robert Watson rwatson at FreeBSD.org
Thu Mar 18 01:55:12 PST 2004


rwatson     2004/03/18 01:55:11 PST

  FreeBSD src repository

  Modified files:
    sys/net              if_tap.c 
  Log:
  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.
  
  Revision  Changes    Path
  1.41      +14 -5     src/sys/net/if_tap.c


More information about the cvs-src mailing list