aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_vnops.c
diff options
context:
space:
mode:
authorBrian Feldman <green@FreeBSD.org>1999-08-04 18:53:50 +0000
committerBrian Feldman <green@FreeBSD.org>1999-08-04 18:53:50 +0000
commite32c66c53972fb584fdbe1dee5af4682f4844de1 (patch)
treed6e2c042eb44488d55222c34691929682097b9f0 /sys/kern/vfs_vnops.c
parent42fd81e3c924794a516ce33d85683f00ebed6909 (diff)
downloadsrc-e32c66c53972fb584fdbe1dee5af4682f4844de1.tar.gz
src-e32c66c53972fb584fdbe1dee5af4682f4844de1.zip
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
Notes
Notes: svn path=/head/; revision=49413
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 04c5ef52749b..c6663de8b8fc 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));
}