Fix one of probably several smbfs issues. smbfs is improperly tracking
authorMatthew Dillon <dillon@dragonflybsd.org>
Sat, 8 Jan 2005 18:57:48 +0000 (18:57 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sat, 8 Jan 2005 18:57:48 +0000 (18:57 +0000)
commit5f74815a6f151050ea57256b9388b900a07d51fa
tree969ae19907180f08d9007f8e73606fa9365cc0fa
parent89aa31f8f1d6102b6f2e3976b23811d1f5dfcf71
Fix one of probably several smbfs issues.  smbfs is improperly tracking
open() and close() calls and closing the remote FID on the last close().
This appears to be done due to the limited number of FIDs available.
The problem is that the vnode might still be referenced and used by mapped
memory (mmap), so smbfs_getpages and putpages will seg-fault the user
program if there is no open descriptor on the file.

For now temporarily reopen and reclose the file.  This is inefficient, but
it should work.  The whole tracking section of smbfs really needs a rewrite.

There are guarenteed to be many other issues with smbfs.

Reported-by: Rumko <rumcic@gmail.com>
sys/vfs/smbfs/smbfs_io.c