Module Name:    src
Committed By:   rmind
Date:           Sun Nov 10 12:46:19 UTC 2013

Modified Files:
        src/sys/fs/tmpfs: tmpfs_subr.c tmpfs_vfsops.c

Log Message:
Handle whiteout case in tmpfs_dir_detach() and tmpfs_unmount().


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/fs/tmpfs/tmpfs_subr.c
cvs rdiff -u -r1.53 -r1.54 src/sys/fs/tmpfs/tmpfs_vfsops.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/fs/tmpfs/tmpfs_subr.c
diff -u src/sys/fs/tmpfs/tmpfs_subr.c:1.84 src/sys/fs/tmpfs/tmpfs_subr.c:1.85
--- src/sys/fs/tmpfs/tmpfs_subr.c:1.84	Sun Nov 10 03:20:20 2013
+++ src/sys/fs/tmpfs/tmpfs_subr.c	Sun Nov 10 12:46:19 2013
@@ -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 @@ tmpfs_dir_detach(tmpfs_node_t *dnode, tm
 
 	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 @@ tmpfs_dir_detach(tmpfs_node_t *dnode, tm
 			events |= NOTE_LINK;
 		}
 	}
+	de->td_node = NULL;
 
 	/* Remove the entry from the directory. */
 	if (dnode->tn_spec.tn_dir.tn_readdir_lastp == de) {

Index: src/sys/fs/tmpfs/tmpfs_vfsops.c
diff -u src/sys/fs/tmpfs/tmpfs_vfsops.c:1.53 src/sys/fs/tmpfs/tmpfs_vfsops.c:1.54
--- src/sys/fs/tmpfs/tmpfs_vfsops.c:1.53	Fri Nov  8 15:44:23 2013
+++ src/sys/fs/tmpfs/tmpfs_vfsops.c	Sun Nov 10 12:46:19 2013
@@ -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 @@ tmpfs_unmount(struct mount *mp, int mntf
 			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);

Reply via email to