nfsd: clean up grace period on early exit
authorJ. Bruce Fields <bfields@citi.umich.edu>
Thu, 20 Nov 2008 20:36:17 +0000 (14:36 -0600)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Mon, 24 Nov 2008 16:12:48 +0000 (10:12 -0600)
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>

fs/lockd/svc.c
fs/nfsd/nfs4state.c

index c631a83..56b0767 100644 (file)
@@ -181,6 +181,7 @@ lockd(void *vrqstp)
        }
        flush_signals(current);
        cancel_delayed_work_sync(&grace_period_end);
+       locks_end_grace(&lockd_manager);
        if (nlmsvc_ops)
                nlmsvc_invalidate_all();
        nlm_shutdown_hosts();
index b0bebc5..1a052ac 100644 (file)
@@ -3261,6 +3261,7 @@ nfs4_state_shutdown(void)
 {
        cancel_rearming_delayed_workqueue(laundry_wq, &laundromat_work);
        destroy_workqueue(laundry_wq);
+       locks_end_grace(&nfsd4_manager);
        nfs4_lock_state();
        nfs4_release_reclaim();
        __nfs4_state_shutdown();