cvs commit: src/sys/fs/fifofs fifo_vnops.c

Don Lewis truckman at FreeBSD.org
Sat May 31 23:24:33 PDT 2003


truckman    2003/05/31 23:24:32 PDT

  FreeBSD src repository

  Modified files:
    sys/fs/fifofs        fifo_vnops.c 
  Log:
  Fix up locking problems in fifo_open() and fifo_close():
  
          Sleep on the vnode interlock while waiting for another
          caller to increment fi_readers or fi_writers.  Hold the
          vnode interlock while incrementing fi_readers or fi_writers
          to prevent a wakeup from being missed.
  
          Only access fi_readers and fi_writers while holding the vnode
          lock.  Previously fifo_close() decremented their values without
          holding a lock.
  
          Move resource deallocation from fifo_close() to fifo_inactive(),
          which allows the VOP_CLOSE() call in the error return path in
          fifo_open() to be removed.  Fifo_open() was calling VOP_CLOSE()
          with the vnode lock held, in violation the current vnode locking
          API.  Also the way fifo_close() used vrefcnt() to decide whether
          to deallocate resources was bogus according to comments in the
          vrefcnt() implementation.
  
  Reviewed by:    bde
  
  Revision  Changes    Path
  1.87      +73 -25    src/sys/fs/fifofs/fifo_vnops.c


More information about the cvs-src mailing list