Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/tmpfs Fix renaming over mismatched non-directory type...



details:   https://anonhg.NetBSD.org/src/rev/31a10b5e4f70
branches:  trunk
changeset: 767236:31a10b5e4f70
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Jul 13 03:28:41 2011 +0000

description:
Fix renaming over mismatched non-directory types in tmpfs.

Renaming a file of any non-directory type over another file of any
other non-directory type is OK -- they need not match as long as
neither is a directory, so loosen the kassert to reflect this.

XXX Need to write test cases for this.

ok dholland, rmind

diffstat:

 sys/fs/tmpfs/tmpfs_vnops.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r aca714fc3be4 -r 31a10b5e4f70 sys/fs/tmpfs/tmpfs_vnops.c
--- a/sys/fs/tmpfs/tmpfs_vnops.c        Tue Jul 12 23:23:17 2011 +0000
+++ b/sys/fs/tmpfs/tmpfs_vnops.c        Wed Jul 13 03:28:41 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tmpfs_vnops.c,v 1.87 2011/06/12 03:35:54 rmind Exp $   */
+/*     $NetBSD: tmpfs_vnops.c,v 1.88 2011/07/13 03:28:41 riastradh Exp $       */
 
 /*
  * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.87 2011/06/12 03:35:54 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.88 2011/07/13 03:28:41 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/dirent.h>
@@ -979,7 +979,7 @@
                        tde = tmpfs_dir_lookup(tdnode, tcnp);
                }
                KASSERT(tde && tde->td_node == tnode);
-               KASSERT(tnode->tn_type == fnode->tn_type);
+               KASSERT((tnode->tn_type == VDIR) == (fnode->tn_type == VDIR));
 
                /*
                 * Remove and destroy the directory entry on the target



Home | Main Index | Thread Index | Old Index