Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern I'm not even going to describe this change. I'll j...



details:   https://anonhg.NetBSD.org/src/rev/6390a757e894
branches:  trunk
changeset: 757319:6390a757e894
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Aug 25 13:51:50 2010 +0000

description:
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.

diffstat:

 sys/kern/vfs_vnops.c |  7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diffs (28 lines):

diff -r dd9e946ee668 -r 6390a757e894 sys/kern/vfs_vnops.c
--- a/sys/kern/vfs_vnops.c      Wed Aug 25 12:43:56 2010 +0000
+++ b/sys/kern/vfs_vnops.c      Wed Aug 25 13:51:50 2010 +0000
@@ -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);



Home | Main Index | Thread Index | Old Index