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/klm/nlm_impl.c
          +++ new/usr/src/uts/common/klm/nlm_impl.c
↓ open down ↓ 2559 lines elided ↑ open up ↑
2560 2560   * belonging to the given export and cleans
2561 2561   * all remote locks and share reservations
2562 2562   * on them.
2563 2563   */
2564 2564  void
2565 2565  nlm_unexport(struct exportinfo *exi)
2566 2566  {
2567 2567          struct nlm_globals *g;
2568 2568          struct nlm_host *hostp;
2569 2569  
2570      -        g = zone_getspecific(nlm_zone_key, curzone);
     2570 +        /* This may be called on behalf of global-zone doing shutdown. */
     2571 +        ASSERT(exi->exi_zone == curzone || curzone == global_zone);
     2572 +        g = zone_getspecific(nlm_zone_key, exi->exi_zone);
     2573 +        if (g == NULL) {
     2574 +                /* Did zone cleanup get here already? */
     2575 +                return;
     2576 +        }
2571 2577  
2572 2578          mutex_enter(&g->lock);
2573 2579          hostp = avl_first(&g->nlm_hosts_tree);
2574 2580          while (hostp != NULL) {
2575 2581                  struct nlm_vhold *nvp;
2576 2582  
2577 2583                  if (hostp->nh_flags & NLM_NH_INIDLE) {
2578 2584                          TAILQ_REMOVE(&g->nlm_idle_hosts, hostp, nh_link);
2579 2585                          hostp->nh_flags &= ~NLM_NH_INIDLE;
2580 2586                  }
↓ open down ↓ 242 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX