NFSD: cancel CB_RECAL call when nfs4_client is about to be destroyed
Subsystems (2)
Dai Ngo
reviewerPATCH 1/1 NFSD: cancel CB_RECAL call when nfs4_client is about to be destroyed
Currently when a nfs4_client is destroyed we wait for the cb_recall callback to complete before proceed. This adds unnecessary delay to the __destroy_client call if there is problem communicating with the client.
This patch addresses this issue by cancelling the CB_RECALL call from the workqueue when the nfs4_client is about to be destroyed.
Signed-off-by Dai Ngo <[email protected]>
--- fs/nfsd/nfs4callback.c | 6 ++++++ fs/nfsd/nfs4state.c | 2 ++ fs/nfsd/state.h | 2 ++ 3 files changed, 10 insertions(+)
fs/nfsd/nfs4callback.c +6 -0
@@ -1578,3 +1578,9 @@ void nfsd41_cb_recall_any_cancel(struct nfs4_client *clp)nfsd41_cb_inflight_end (clp); } } + +void nfsd4_cb_recall_cancel (struct nfs4_client *clp,struct nfs4_delegation *dp) +{ +if (cancel_delayed_work (&dp->dl_recall.cb_work)) +nfsd41_cb_inflight_end (clp); +}
fs/nfsd/nfs4state.c +2 -0
@@ -2378,6 +2378,8 @@ __destroy_client(struct nfs4_client *clp)while (!list_empty (&reaplist)) { dp = list_entry(reaplist.next, struct nfs4_delegation, dl_recall_lru);list_del_init (&dp->dl_recall_lru); +if (dp->dl_recalled) +nfsd4_cb_recall_cancel (clp, dp);destroy_unhashed_deleg (dp); }while (!list_empty (&clp->cl_revoked)) {
fs/nfsd/state.h +2 -0
@@ -736,6 +736,8 @@ extern void nfsd4_init_cb(struct nfsd4_callback *cb, struct nfs4_client *clp, const struct nfsd4_callback_ops *ops, enum nfsd4_cb_op op);extern bool nfsd4_run_cb (struct nfsd4_callback *cb);extern void nfsd41_cb_recall_any_cancel (struct nfs4_client *clp); +extern void nfsd4_cb_recall_cancel (struct nfs4_client *clp, +struct nfs4_delegation *dp);extern int nfsd4_create_callback_queue (void );extern void nfsd4_destroy_callback_queue (void );extern void nfsd4_shutdown_callback (struct nfs4_client *);
Signature · 1 line
2.39.3