Module Name: src
Committed By: pooka
Date: Wed Aug 25 13:51:50 UTC 2010
Modified Files:
src/sys/kern: vfs_vnops.c
Log Message:
I'm not even going to describe this change. I'll just say that
churn creates interesting code.
Fixes open(O_CREAT|O_TRUNC) on at least tmpfs and nfs to not fail
with ENOENT due to a racy removal of the newly created file.
Caught, as most bugs these days are, by a test run.
To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/sys/kern/vfs_vnops.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/vfs_vnops.c
diff -u src/sys/kern/vfs_vnops.c:1.176 src/sys/kern/vfs_vnops.c:1.177
--- src/sys/kern/vfs_vnops.c:1.176 Wed Jul 28 09:30:21 2010
+++ src/sys/kern/vfs_vnops.c Wed Aug 25 13:51:50 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_vnops.c,v 1.176 2010/07/28 09:30:21 hannken Exp $ */
+/* $NetBSD: vfs_vnops.c,v 1.177 2010/08/25 13:51:50 pooka Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.176 2010/07/28 09:30:21 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.177 2010/08/25 13:51:50 pooka Exp $");
#include "veriexec.h"
@@ -215,9 +215,6 @@
}
if (fmode & O_TRUNC) {
- VOP_UNLOCK(vp); /* XXX */
-
- vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); /* XXX */
vattr_null(&va);
va.va_size = 0;
error = VOP_SETATTR(vp, &va, cred);