summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_vnops.c
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>1999-08-04 18:53:50 +0000
committergreen <green@FreeBSD.org>1999-08-04 18:53:50 +0000
commitc03366a55d4ace981b016ae999ae67675c486cdd (patch)
tree12cd9e195ff9e1b516242767963c6e156b837539 /sys/kern/vfs_vnops.c
parent0ab4dad80912358b49a3cee9e433dbd909334d19 (diff)
downloadFreeBSD-src-c03366a55d4ace981b016ae999ae67675c486cdd.zip
FreeBSD-src-c03366a55d4ace981b016ae999ae67675c486cdd.tar.gz
Fix fd race conditions (during shared fd table usage.) Badfileops is
now used in f_ops in place of NULL, and modifications to the files are more carefully ordered. f_ops should also be set to &badfileops upon "close" of a file. This does not fix other problems mentioned in this PR than the first one. PR: 11629 Reviewed by: peter
Diffstat (limited to 'sys/kern/vfs_vnops.c')
-rw-r--r--sys/kern/vfs_vnops.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 04c5ef5..c6663de 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_vnops.c 8.2 (Berkeley) 1/21/94
- * $Id: vfs_vnops.c,v 1.70 1999/07/08 06:05:56 mckusick Exp $
+ * $Id: vfs_vnops.c,v 1.71 1999/07/26 06:25:18 alc Exp $
*/
#include <sys/param.h>
@@ -48,6 +48,7 @@
#include <sys/mount.h>
#include <sys/namei.h>
#include <sys/vnode.h>
+#include <sys/buf.h>
#include <sys/filio.h>
#include <sys/ttycom.h>
@@ -563,6 +564,7 @@ vn_closefile(fp, p)
struct proc *p;
{
+ fp->f_ops = &badfileops;
return (vn_close(((struct vnode *)fp->f_data), fp->f_flag,
fp->f_cred, p));
}
OpenPOWER on IntegriCloud