diff options
author | truckman <truckman@FreeBSD.org> | 2003-06-01 06:24:32 +0000 |
---|---|---|
committer | truckman <truckman@FreeBSD.org> | 2003-06-01 06:24:32 +0000 |
commit | 0c845cdfd3600f71462c21354069c53fedeb9be0 (patch) | |
tree | b9fc3efbdf79a42b996d79d6995ef01b53578268 /usr.bin | |
parent | 564a07d9bee28ef03ba5bfec4c4d63da78f8948b (diff) | |
download | FreeBSD-src-0c845cdfd3600f71462c21354069c53fedeb9be0.zip FreeBSD-src-0c845cdfd3600f71462c21354069c53fedeb9be0.tar.gz |
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
Diffstat (limited to 'usr.bin')
0 files changed, 0 insertions, 0 deletions