Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 May 2003 23:24:32 -0700 (PDT)
From:      Don Lewis <truckman@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/fs/fifofs fifo_vnops.c
Message-ID:  <200306010624.h516OWX5097169@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200306010624.h516OWX5097169>