Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/tmpfs Prevent a diagnostic assertion in tmpfs_rmdir()...



details:   https://anonhg.NetBSD.org/src/rev/c6e420a47ced
branches:  trunk
changeset: 325887:c6e420a47ced
user:      pedro <pedro%NetBSD.org@localhost>
date:      Fri Jan 10 16:42:38 2014 +0000

description:
Prevent a diagnostic assertion in tmpfs_rmdir() from being triggered
through an rmdir on ".." by moving it so it happens after the check for
empty directories; OK rmind@.

diffstat:

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

diffs (35 lines):

diff -r 92f088bee96a -r c6e420a47ced sys/fs/tmpfs/tmpfs_vnops.c
--- a/sys/fs/tmpfs/tmpfs_vnops.c        Fri Jan 10 16:41:16 2014 +0000
+++ b/sys/fs/tmpfs/tmpfs_vnops.c        Fri Jan 10 16:42:38 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tmpfs_vnops.c,v 1.111 2014/01/03 09:53:12 hannken Exp $        */
+/*     $NetBSD: tmpfs_vnops.c,v 1.112 2014/01/10 16:42:38 pedro 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.111 2014/01/03 09:53:12 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.112 2014/01/10 16:42:38 pedro Exp $");
 
 #include <sys/param.h>
 #include <sys/dirent.h>
@@ -837,7 +837,6 @@
 
        KASSERT(VOP_ISLOCKED(dvp));
        KASSERT(VOP_ISLOCKED(vp));
-       KASSERT(node->tn_spec.tn_dir.tn_parent == dnode);
 
        /*
         * Directories with more than two entries ('.' and '..') cannot be
@@ -861,6 +860,8 @@
                KASSERT(error == 0);
        }
 
+       KASSERT(node->tn_spec.tn_dir.tn_parent == dnode);
+
        /* Lookup the directory entry (check the cached hint first). */
        de = tmpfs_dir_cached(node);
        if (de == NULL) {



Home | Main Index | Thread Index | Old Index