Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/tmpfs Handle whiteout case in tmpfs_dir_detach() and ...



details:   https://anonhg.NetBSD.org/src/rev/008bc1156869
branches:  trunk
changeset: 791253:008bc1156869
user:      rmind <rmind%NetBSD.org@localhost>
date:      Sun Nov 10 12:46:19 2013 +0000

description:
Handle whiteout case in tmpfs_dir_detach() and tmpfs_unmount().

diffstat:

 sys/fs/tmpfs/tmpfs_subr.c   |  6 +++---
 sys/fs/tmpfs/tmpfs_vfsops.c |  7 ++++---
 2 files changed, 7 insertions(+), 6 deletions(-)

diffs (62 lines):

diff -r 4683b3726e24 -r 008bc1156869 sys/fs/tmpfs/tmpfs_subr.c
--- a/sys/fs/tmpfs/tmpfs_subr.c Sun Nov 10 12:07:52 2013 +0000
+++ b/sys/fs/tmpfs/tmpfs_subr.c Sun Nov 10 12:46:19 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tmpfs_subr.c,v 1.84 2013/11/10 03:20:20 christos Exp $ */
+/*     $NetBSD: tmpfs_subr.c,v 1.85 2013/11/10 12:46:19 rmind Exp $    */
 
 /*
  * Copyright (c) 2005-2013 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_subr.c,v 1.84 2013/11/10 03:20:20 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_subr.c,v 1.85 2013/11/10 12:46:19 rmind Exp $");
 
 #include <sys/param.h>
 #include <sys/dirent.h>
@@ -520,7 +520,6 @@
 
        if (__predict_true(node != TMPFS_NODE_WHITEOUT)) {
                /* Deassociate the inode and entry. */
-               de->td_node = NULL;
                node->tn_dirent_hint = NULL;
 
                KASSERT(node->tn_links > 0);
@@ -541,6 +540,7 @@
                        events |= NOTE_LINK;
                }
        }
+       de->td_node = NULL;
 
        /* Remove the entry from the directory. */
        if (dnode->tn_spec.tn_dir.tn_readdir_lastp == de) {
diff -r 4683b3726e24 -r 008bc1156869 sys/fs/tmpfs/tmpfs_vfsops.c
--- a/sys/fs/tmpfs/tmpfs_vfsops.c       Sun Nov 10 12:07:52 2013 +0000
+++ b/sys/fs/tmpfs/tmpfs_vfsops.c       Sun Nov 10 12:46:19 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tmpfs_vfsops.c,v 1.53 2013/11/08 15:44:23 rmind Exp $  */
+/*     $NetBSD: tmpfs_vfsops.c,v 1.54 2013/11/10 12:46:19 rmind Exp $  */
 
 /*
  * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_vfsops.c,v 1.53 2013/11/08 15:44:23 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_vfsops.c,v 1.54 2013/11/10 12:46:19 rmind Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -230,7 +230,8 @@
                        continue;
                }
                while ((de = TAILQ_FIRST(&node->tn_spec.tn_dir.tn_dir)) != NULL) {
-                       if ((cnode = de->td_node) != NULL) {
+                       cnode = de->td_node;
+                       if (cnode && cnode != TMPFS_NODE_WHITEOUT) {
                                cnode->tn_vnode = NULL;
                        }
                        tmpfs_dir_detach(node, de);



Home | Main Index | Thread Index | Old Index