Print this page
Revert exi_zone to exi_zoneid, and install exi_ne backpointer
Caution with use after exi_rele()
Dan mods to NFS desgin problems re. multiple zone keys
curzone reality check and teardown changes to use the RIGHT zone
Try to remove assumption that zone's root vnode is marked VROOT
        
*** 415,434 ****
  rfs_climb_crossmnt(vnode_t **dvpp, struct exportinfo **exip, cred_t *cr)
  {
          struct exportinfo *exi;
          vnode_t *dvp = *dvpp;
  
!         ASSERT(dvp->v_flag & VROOT);
  
          VN_HOLD(dvp);
          dvp = untraverse(dvp);
          exi = nfs_vptoexi(NULL, dvp, cr, NULL, NULL, FALSE);
          if (exi == NULL) {
                  VN_RELE(dvp);
                  return (-1);
          }
  
          exi_rele(*exip);
          *exip = exi;
          VN_RELE(*dvpp);
          *dvpp = dvp;
  
--- 415,436 ----
  rfs_climb_crossmnt(vnode_t **dvpp, struct exportinfo **exip, cred_t *cr)
  {
          struct exportinfo *exi;
          vnode_t *dvp = *dvpp;
  
!         ASSERT3U((*exip)->exi_zoneid, ==, curzone->zone_id);
!         ASSERT((dvp->v_flag & VROOT) || VN_IS_CURZONEROOT(dvp));
  
          VN_HOLD(dvp);
          dvp = untraverse(dvp);
          exi = nfs_vptoexi(NULL, dvp, cr, NULL, NULL, FALSE);
          if (exi == NULL) {
                  VN_RELE(dvp);
                  return (-1);
          }
  
+         ASSERT3U(exi->exi_zoneid, ==, curzone->zone_id);
          exi_rele(*exip);
          *exip = exi;
          VN_RELE(*dvpp);
          *dvpp = dvp;
  
*** 485,504 ****
                          return;
                  }
          }
  
          exi_hold(exi);
  
          /*
           * Not allow lookup beyond root.
           * If the filehandle matches a filehandle of the exi,
           * then the ".." refers beyond the root of an exported filesystem.
           */
          if (strcmp(da->da_name, "..") == 0 &&
              EQFID(&exi->exi_fid, (fid_t *)&fhp->fh_len)) {
                  if ((exi->exi_export.ex_flags & EX_NOHIDE) &&
!                     (dvp->v_flag & VROOT)) {
                          /*
                           * special case for ".." and 'nohide'exported root
                           */
                          if (rfs_climb_crossmnt(&dvp, &exi, cr) != 0) {
                                  error = NFSERR_ACCES;
--- 487,507 ----
                          return;
                  }
          }
  
          exi_hold(exi);
+         ASSERT3U(exi->exi_zoneid, ==, curzone->zone_id);
  
          /*
           * Not allow lookup beyond root.
           * If the filehandle matches a filehandle of the exi,
           * then the ".." refers beyond the root of an exported filesystem.
           */
          if (strcmp(da->da_name, "..") == 0 &&
              EQFID(&exi->exi_fid, (fid_t *)&fhp->fh_len)) {
                  if ((exi->exi_export.ex_flags & EX_NOHIDE) &&
!                     ((dvp->v_flag & VROOT) || VN_IS_CURZONEROOT(dvp))) {
                          /*
                           * special case for ".." and 'nohide'exported root
                           */
                          if (rfs_climb_crossmnt(&dvp, &exi, cr) != 0) {
                                  error = NFSERR_ACCES;
*** 530,539 ****
--- 533,543 ----
           */
          if (PUBLIC_FH2(fhp)) {
                  publicfh_flag = TRUE;
  
                  exi_rele(exi);
+                 exi = NULL;
  
                  error = rfs_publicfh_mclookup(name, dvp, cr, &vp, &exi,
                      &sec);
          } else {
                  /*
*** 1316,1325 ****
--- 1320,1330 ----
          cred_t *savecred;
          int in_crit = 0;
          caller_context_t ct;
          nfs_srv_t *nsrv;
  
+         ASSERT(exi == NULL || exi->exi_zoneid == curzone->zone_id);
          nsrv = nfs_get_srv();
          if (!nsrv->write_async) {
                  rfs_write_sync(wa, ns, exi, req, cr, ro);
                  return;
          }