changeset 12628:7da42ae5ee37

6954736 stop -f /SYS on one Otoro head causes the other head to panic
author Pavel Filipensky <Pavel.Filipensky@Sun.COM>
date Wed, 16 Jun 2010 09:11:16 +0200
parents 14a7fd60c4c5
children 8a89ca2bbe3a
files usr/src/uts/common/fs/nfs/nfs4_srv_ns.c
diffstat 1 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/fs/nfs/nfs4_srv_ns.c	Tue Jun 15 22:56:55 2010 -0700
+++ b/usr/src/uts/common/fs/nfs/nfs4_srv_ns.c	Wed Jun 16 09:11:16 2010 +0200
@@ -501,21 +501,23 @@
 		 * connect_point for the curr->tree_vis. No need for EQFID.
 		 */
 		child = tree_find_child_by_vis(connect_point, curr->tree_vis);
-		if (child) { /* Merging */
+
+		/*
+		 * Merging cannot be done if a valid child->tree_exi would
+		 * be overwritten by a new curr->tree_exi.
+		 */
+		if (child &&
+		    (child->tree_exi == NULL || curr->tree_exi == NULL)) {
 			if (curr->tree_exi) { /* Transfer the exportinfo */
-				/*
-				 * more_visible() is not called for a reshare,
-				 * so the existing tree_exi must be NULL.
-				 */
-				ASSERT(child->tree_exi == NULL);
 				child->tree_exi = curr->tree_exi;
 				child->tree_exi->exi_tree = child;
 			}
 			kmem_free(curr, sizeof (treenode_t));
+			connect_point = child;
 		} else { /* Branching */
 			tree_add_child(connect_point, curr);
+			connect_point = NULL;
 		}
-		connect_point = child;
 	}
 }