nfsd: clean up grace period on early exit

If nfsd was shut down before the grace period ended, we could end up
with a freed object still on grace_list. Thanks to Jeff Moyer for
reporting the resulting list corruption warnings.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Tested-by: Jeff Moyer <jmoyer@redhat.com>

+2
+1
fs/lockd/svc.c
··· 181 } 182 flush_signals(current); 183 cancel_delayed_work_sync(&grace_period_end); 184 if (nlmsvc_ops) 185 nlmsvc_invalidate_all(); 186 nlm_shutdown_hosts();
··· 181 } 182 flush_signals(current); 183 cancel_delayed_work_sync(&grace_period_end); 184 + locks_end_grace(&lockd_manager); 185 if (nlmsvc_ops) 186 nlmsvc_invalidate_all(); 187 nlm_shutdown_hosts();
+1
fs/nfsd/nfs4state.c
··· 3261 { 3262 cancel_rearming_delayed_workqueue(laundry_wq, &laundromat_work); 3263 destroy_workqueue(laundry_wq); 3264 nfs4_lock_state(); 3265 nfs4_release_reclaim(); 3266 __nfs4_state_shutdown();
··· 3261 { 3262 cancel_rearming_delayed_workqueue(laundry_wq, &laundromat_work); 3263 destroy_workqueue(laundry_wq); 3264 + locks_end_grace(&nfsd4_manager); 3265 nfs4_lock_state(); 3266 nfs4_release_reclaim(); 3267 __nfs4_state_shutdown();