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/nfs/export.h
          +++ new/usr/src/uts/common/nfs/export.h
↓ open down ↓ 473 lines elided ↑ open up ↑
 474  474  
 475  475  /*
 476  476   * TREE_ROOT checks if the node corresponds to a filesystem root or
 477  477   * the zone's root directory.
 478  478   * TREE_EXPORTED checks if the node is explicitly shared
 479  479   */
 480  480  
 481  481  #define TREE_ROOT(t) \
 482  482          ((t)->tree_exi != NULL && \
 483  483          (((t)->tree_exi->exi_vp->v_flag & VROOT) || \
 484      -        VN_IS_CURZONEROOT((t)->tree_exi->exi_vp)))
      484 +        VN_CMP((t)->tree_exi->exi_zone->zone_rootvp, (t)->tree_exi->exi_vp)))
 485  485  
 486  486  #define TREE_EXPORTED(t) \
 487  487          ((t)->tree_exi && !PSEUDO((t)->tree_exi))
 488  488  
 489  489  #define EXPTABLESIZE   256
 490  490  
 491  491  struct exp_hash {
 492  492          struct exportinfo       *prev;  /* ptr to the previous exportinfo */
 493  493          struct exportinfo       *next;  /* ptr to the next exportinfo */
 494  494          struct exportinfo       **bckt; /* backpointer to the hash bucket */
↓ open down ↓ 31 lines elided ↑ open up ↑
 526  526          vnode_t                 *exi_vp;
 527  527          vnode_t                 *exi_dvp;
 528  528          avl_tree_t              *exi_cache[AUTH_TABLESIZE];
 529  529          struct log_buffer       *exi_logbuffer;
 530  530          struct exp_visible      *exi_visible;
 531  531          struct charset_cache    *exi_charset;
 532  532          unsigned                exi_volatile_dev:1;
 533  533          unsigned                exi_moved:1;
 534  534          int                     exi_id;
 535  535          avl_node_t              exi_id_link;
 536      -        zoneid_t                exi_zoneid;
      536 +        /*
      537 +         * Soft-reference/backpointer to the zone.  The ZSD callbacks we have
      538 +         * invoke cleanup code that crosses into OTHER cleanup functions that
      539 +         * may assume same-zone context and attempt to find their own ZSD,
      540 +         * using "curzone" when in fact "curzone" is global when called from
      541 +         * NFS's ZSD cleanup (see lm_unexport->nlm_unexport for an example).
      542 +         *
      543 +         * During ZSD shutdown or destroy callbacks, the zone structure
      544 +         * does not have its mutex held, and it has just-enough references
      545 +         * to not free from underneath us.  This field is not a proper
      546 +         * referenced-held zone pointer, and only ZSD callbacks should use
      547 +         * it.
      548 +         */
      549 +        struct zone             *exi_zone;
 537  550  #ifdef VOLATILE_FH_TEST
 538  551          uint32_t                exi_volatile_id;
 539  552          struct ex_vol_rename    *exi_vol_rename;
 540  553          kmutex_t                exi_vol_rename_lock;
 541  554  #endif /* VOLATILE_FH_TEST */
 542  555  };
      556 +#define exi_zoneid exi_zone->zone_id
 543  557  
 544  558  typedef struct exportinfo exportinfo_t;
 545  559  typedef struct exportdata exportdata_t;
 546  560  typedef struct secinfo secinfo_t;
 547  561  
 548  562  /*
 549  563   * exp_visible is a visible list per filesystem. It is for filesystems
 550  564   * that may need a limited view of its contents. A pseudo export and
 551  565   * a real export at the mount point (VROOT) which has a subtree shared
 552  566   * has a visible list.
↓ open down ↓ 175 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX