Print this page
Bad assertions
nfs_export_zone_init() can't assume called in zone-context.
curzone reality check and teardown changes to use the RIGHT zone

@@ -690,14 +690,22 @@
  */
 exportinfo_t *
 vis2exi(treenode_t *tnode)
 {
         exportinfo_t *exi_ret = NULL;
+#ifdef DEBUG
+        zone_t *zone = NULL;
+#endif
 
         for (;;) {
                 tnode = tnode->tree_parent;
+#ifdef DEBUG
+                if (zone == NULL && tnode->tree_exi != NULL)
+                        zone = tnode->tree_exi->exi_zone;
+#endif
                 if (TREE_ROOT(tnode)) {
+                        ASSERT3P(zone, ==, tnode->tree_exi->exi_zone);
                         exi_ret = tnode->tree_exi;
                         break;
                 }
         }
 

@@ -873,11 +881,12 @@
         ne->exi_root->exi_export.ex_path[1] = '\0';
 
         ne->exi_root->exi_count = 1;
         mutex_init(&ne->exi_root->exi_lock, NULL, MUTEX_DEFAULT, NULL);
 
-        ne->exi_root->exi_vp = ZONE_ROOTVP();
+        ne->exi_root->exi_zone = zone_find_by_id_nolock(zoneid);
+        ne->exi_root->exi_vp = ne->exi_root->exi_zone->zone_rootvp;
         ne->exi_rootfid.fid_len = MAXFIDSZ;
         if (vop_fid_pseudo(ne->exi_root->exi_vp, &ne->exi_rootfid) != 0) {
                 mutex_destroy(&ne->exi_root->exi_lock);
                 kmem_free(ne->exi_root->exi_export.ex_path,
                     ne->exi_root->exi_export.ex_pathlen + 1);

@@ -1298,11 +1307,13 @@
         exi = kmem_zalloc(sizeof (*exi), KM_SLEEP);
         exi->exi_fsid = fsid;
         exi->exi_fid = fid;
         exi->exi_vp = vp;
         exi->exi_count = 1;
-        exi->exi_zoneid = crgetzoneid(cr);
+        exi->exi_zone = crgetzone(cr);
+        ASSERT(exi->exi_zone != NULL);          /* XXX KEBE ASKS... */
+        ASSERT3P(exi->exi_zone, ==, curzone);   /* ... are these legit? */
         exi->exi_volatile_dev = (vfssw[vp->v_vfsp->vfs_fstype].vsw_flag &
             VSW_VOLATILEDEV) ? 1 : 0;
         mutex_init(&exi->exi_lock, NULL, MUTEX_DEFAULT, NULL);
         exi->exi_dvp = dvp;
 

@@ -1812,10 +1823,11 @@
                 newexi = pseudo_exportfs(ne, exi->exi_vp, &exi->exi_fid,
                     exi->exi_visible, &exi->exi_export);
                 exi->exi_visible = NULL;
 
                 /* interconnect the existing treenode with the new exportinfo */
+                newexi->exi_zone = exi->exi_zone;
                 newexi->exi_tree = exi->exi_tree;
                 newexi->exi_tree->tree_exi = newexi;
 
                 /* Update the change timestamp */
                 tree_update_change(ne, exi->exi_tree, NULL);

@@ -1841,10 +1853,15 @@
 
         /*
          * If this was a public export, restore
          * the public filehandle to the root.
          */
+
+        /*
+         * XXX KEBE ASKS --> Should CRED() instead be
+         * exi->exi_zone->zone_kcred?
+         */
         if (exi == ne->exi_public) {
                 ne->exi_public = ne->exi_root;
 
                 nfslog_share_record(ne->exi_public, CRED());
         }