Print this page
Revert "NEX-20260 NFS hung in transitional state when RSF marks it maintenance"
This reverts commit 9bf6e5f740709f470ba350df64cd9f2c93f3f0a7.


1508         mutex_enter(&nsrv4->state_lock);
1509 
1510         if (nsrv4->nfs4_server_state == NULL) {
1511                 mutex_exit(&nsrv4->state_lock);
1512                 return;
1513         }
1514 
1515         /* destroy server instances and current instance ptr */
1516         rfs4_servinst_destroy_all(nsrv4);
1517 
1518         /* reset the "first NFSv4 request" status */
1519         nsrv4->seen_first_compound = 0;
1520 
1521         dbp = nsrv4->nfs4_server_state;
1522         nsrv4->nfs4_server_state = NULL;
1523 
1524         rw_destroy(&nsrv4->rfs4_findclient_lock);
1525 
1526         /* First stop all of the reaper threads in the database */
1527         rfs4_database_shutdown(dbp);

1528         /*
1529          * WARNING: There may be consumers of the rfs4 database still
1530          * active as we destroy these.  IF that's the case, consider putting
1531          * some of their _zone_fini()-like functions into the zsd key as
1532          * ~~SHUTDOWN~~ functions instead of ~~DESTROY~~ functions.  We can
1533          * maintain some ordering guarantees better that way.
1534          */
1535         /* Now destroy/release the database tables */
1536         rfs4_database_destroy(dbp);
1537 
1538         /* Reset the cache timers for next time */
1539         nsrv4->rfs4_client_cache_time = 0;
1540         nsrv4->rfs4_openowner_cache_time = 0;
1541         nsrv4->rfs4_state_cache_time = 0;
1542         nsrv4->rfs4_lo_state_cache_time = 0;
1543         nsrv4->rfs4_lockowner_cache_time = 0;
1544         nsrv4->rfs4_file_cache_time = 0;
1545         nsrv4->rfs4_deleg_state_cache_time = 0;
1546 
1547         mutex_exit(&nsrv4->state_lock);




1508         mutex_enter(&nsrv4->state_lock);
1509 
1510         if (nsrv4->nfs4_server_state == NULL) {
1511                 mutex_exit(&nsrv4->state_lock);
1512                 return;
1513         }
1514 
1515         /* destroy server instances and current instance ptr */
1516         rfs4_servinst_destroy_all(nsrv4);
1517 
1518         /* reset the "first NFSv4 request" status */
1519         nsrv4->seen_first_compound = 0;
1520 
1521         dbp = nsrv4->nfs4_server_state;
1522         nsrv4->nfs4_server_state = NULL;
1523 
1524         rw_destroy(&nsrv4->rfs4_findclient_lock);
1525 
1526         /* First stop all of the reaper threads in the database */
1527         rfs4_database_shutdown(dbp);
1528 
1529         /*
1530          * WARNING: There may be consumers of the rfs4 database still
1531          * active as we destroy these.  IF that's the case, consider putting
1532          * some of their _zone_fini()-like functions into the zsd key as
1533          * ~~SHUTDOWN~~ functions instead of ~~DESTROY~~ functions.  We can
1534          * maintain some ordering guarantees better that way.
1535          */
1536         /* Now destroy/release the database tables */
1537         rfs4_database_destroy(dbp);
1538 
1539         /* Reset the cache timers for next time */
1540         nsrv4->rfs4_client_cache_time = 0;
1541         nsrv4->rfs4_openowner_cache_time = 0;
1542         nsrv4->rfs4_state_cache_time = 0;
1543         nsrv4->rfs4_lo_state_cache_time = 0;
1544         nsrv4->rfs4_lockowner_cache_time = 0;
1545         nsrv4->rfs4_file_cache_time = 0;
1546         nsrv4->rfs4_deleg_state_cache_time = 0;
1547 
1548         mutex_exit(&nsrv4->state_lock);