Print this page
curzone reality check and teardown changes to use the RIGHT zone

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/nfs/nfs_srv.c
          +++ new/usr/src/uts/common/fs/nfs/nfs_srv.c
↓ open down ↓ 403 lines elided ↑ open up ↑
 404  404   * Given mounted "dvp" and "exi", go upper mountpoint
 405  405   * with dvp/exi correction
 406  406   * Return 0 in success
 407  407   */
 408  408  int
 409  409  rfs_climb_crossmnt(vnode_t **dvpp, struct exportinfo **exip, cred_t *cr)
 410  410  {
 411  411          struct exportinfo *exi;
 412  412          vnode_t *dvp = *dvpp;
 413  413  
      414 +        ASSERT3P((*exip)->exi_zone, ==, curzone);
 414  415          ASSERT((dvp->v_flag & VROOT) || VN_IS_CURZONEROOT(dvp));
 415  416  
 416  417          VN_HOLD(dvp);
 417  418          dvp = untraverse(dvp);
 418  419          exi = nfs_vptoexi(NULL, dvp, cr, NULL, NULL, FALSE);
 419  420          if (exi == NULL) {
 420  421                  VN_RELE(dvp);
 421  422                  return (-1);
 422  423          }
 423  424  
      425 +        ASSERT3P(exi->exi_zone, ==, curzone);
 424  426          exi_rele(*exip);
 425  427          *exip = exi;
 426  428          VN_RELE(*dvpp);
 427  429          *dvpp = dvp;
 428  430  
 429  431          return (0);
 430  432  }
 431  433  /*
 432  434   * Directory lookup.
 433  435   * Returns an fhandle and file attributes for file name in a directory.
↓ open down ↓ 40 lines elided ↑ open up ↑
 474  476                  VN_HOLD(dvp);
 475  477          } else {
 476  478                  dvp = nfs_fhtovp(fhp, exi);
 477  479                  if (dvp == NULL) {
 478  480                          dr->dr_status = NFSERR_STALE;
 479  481                          return;
 480  482                  }
 481  483          }
 482  484  
 483  485          exi_hold(exi);
      486 +        ASSERT3P(exi->exi_zone, ==, curzone);
 484  487  
 485  488          /*
 486  489           * Not allow lookup beyond root.
 487  490           * If the filehandle matches a filehandle of the exi,
 488  491           * then the ".." refers beyond the root of an exported filesystem.
 489  492           */
 490  493          if (strcmp(da->da_name, "..") == 0 &&
 491  494              EQFID(&exi->exi_fid, (fid_t *)&fhp->fh_len)) {
 492  495                  if ((exi->exi_export.ex_flags & EX_NOHIDE) &&
 493  496                      ((dvp->v_flag & VROOT) || VN_IS_CURZONEROOT(dvp))) {
↓ open down ↓ 811 lines elided ↑ open up ↑
1305 1308          uint_t off;
1306 1309          uint_t len;
1307 1310          struct rfs_async_write nrpsp;
1308 1311          struct rfs_async_write_list nlpsp;
1309 1312          ushort_t t_flag;
1310 1313          cred_t *savecred;
1311 1314          int in_crit = 0;
1312 1315          caller_context_t ct;
1313 1316          nfs_srv_t *nsrv;
1314 1317  
     1318 +        ASSERT3P(curzone, ==, ((exi == NULL) ? curzone : exi->exi_zone));
1315 1319          nsrv = zone_getspecific(rfs_zone_key, curzone);
1316 1320          if (!nsrv->write_async) {
1317 1321                  rfs_write_sync(wa, ns, exi, req, cr, ro);
1318 1322                  return;
1319 1323          }
1320 1324  
1321 1325          /*
1322 1326           * Initialize status to RFSWRITE_INITVAL instead of 0, since value of 0
1323 1327           * is considered an OK.
1324 1328           */
↓ open down ↓ 1829 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX