Print this page
Hyperaggressive asserts pt 1/N
Ooops exi_zoneid isn't a variable again yet
Be far more judicious in the use of curzone-using macros.

*** 717,733 **** /* * For NFS V4. * Add or remove the newly exported or unexported security flavors of the * given exportinfo from its ancestors upto the system root. */ ! void srv_secinfo_treeclimb(nfs_export_t *ne, exportinfo_t *exip, secinfo_t *sec, int seccnt, bool_t isadd) { treenode_t *tnode; ASSERT(RW_WRITE_HELD(&ne->exported_lock)); /* * exi_tree can be null for the zone root * which means we're already at the "top" * and there's nothing more to "climb". --- 717,734 ---- /* * For NFS V4. * Add or remove the newly exported or unexported security flavors of the * given exportinfo from its ancestors upto the system root. */ ! static void srv_secinfo_treeclimb(nfs_export_t *ne, exportinfo_t *exip, secinfo_t *sec, int seccnt, bool_t isadd) { treenode_t *tnode; ASSERT(RW_WRITE_HELD(&ne->exported_lock)); + ASSERT3U(exip->exi_zoneid, ==, curzone->zone_id); /* * exi_tree can be null for the zone root * which means we're already at the "top" * and there's nothing more to "climb".
*** 814,824 **** export_link(nfs_export_t *ne, exportinfo_t *exi) { exportinfo_t **bckt; ASSERT(RW_WRITE_HELD(&ne->exported_lock)); - ASSERT(exi->exi_zoneid == ne->ne_globals->nfs_zoneid); bckt = &ne->exptable[exptablehash(&exi->exi_fsid, &exi->exi_fid)]; exp_hash_link(exi, fid_hash, bckt); bckt = &ne->exptable_path_hash[pkp_tab_hash(exi->exi_export.ex_path, --- 815,824 ----
*** 898,907 **** --- 898,908 ---- void nfs_export_zone_init(nfs_globals_t *ng) { int i; nfs_export_t *ne; + zone_t *zone; ne = kmem_zalloc(sizeof (*ne), KM_SLEEP); rw_init(&ne->exported_lock, NULL, RW_DEFAULT, NULL);
*** 922,934 **** 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); ! ASSERT(curzone->zone_id == ng->nfs_zoneid); ! ne->exi_root->exi_vp = ZONE_ROOTVP(); ! ne->exi_root->exi_zoneid = ng->nfs_zoneid; /* * Fill in ne->exi_rootfid later, in nfs_export_get_rootfid * because we can't correctly return errors here. */ --- 923,942 ---- 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); ! /* ! * Because we cannot: ! * ASSERT(curzone->zone_id == ng->nfs_zoneid); ! * We grab the zone pointer explicitly (like netstacks do) and ! * set the rootvp here. ! */ ! zone = zone_find_by_id_nolock(ng->nfs_zoneid); ! ne->exi_root->exi_vp = zone->zone_rootvp; ! ne->exi_root->exi_zone = zone; /* XXX KEBE SAYS lose me, and... */ ! /* ne->exi_root->exi_zoneid = ng->nfs_zoneid; */ /* use me instead! */ /* * Fill in ne->exi_rootfid later, in nfs_export_get_rootfid * because we can't correctly return errors here. */
*** 1918,1928 **** 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); --- 1926,1936 ---- 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; /* XXX KEBE SAYS LOSE ME */ newexi->exi_tree = exi->exi_tree; newexi->exi_tree->tree_exi = newexi; /* Update the change timestamp */ tree_update_change(ne, exi->exi_tree, NULL);
*** 2187,2196 **** --- 2195,2205 ---- /* * We have just failed finding a matching export. * If we're at the root of this filesystem, then * it's time to stop (with failure). */ + ASSERT3P(vp->v_vfsp->vfs_zone, ==, curzone); if ((vp->v_flag & VROOT) || VN_IS_CURZONEROOT(vp)) { error = EINVAL; break; }