Skip to content

Commit

Permalink
nfsd: handle errors from rpc_call_async()
Browse files Browse the repository at this point in the history
It's possible for rpc_call_async() to fail (mainly due to memory
allocation failure). If it does, there isn't much recourse other than to
requeue the callback and try again later.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
  • Loading branch information
Jeff Layton authored and Chuck Lever committed Mar 10, 2025
1 parent 32ce62c commit ff383e8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions fs/nfsd/nfs4callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -1592,7 +1592,7 @@ nfsd4_run_cb_work(struct work_struct *work)
container_of(work, struct nfsd4_callback, cb_work);
struct nfs4_client *clp = cb->cb_clp;
struct rpc_clnt *clnt;
int flags;
int flags, ret;

trace_nfsd_cb_start(clp);

Expand Down Expand Up @@ -1625,8 +1625,12 @@ nfsd4_run_cb_work(struct work_struct *work)

cb->cb_msg.rpc_cred = clp->cl_cb_cred;
flags = clp->cl_minorversion ? RPC_TASK_NOCONNECT : RPC_TASK_SOFTCONN;
rpc_call_async(clnt, &cb->cb_msg, RPC_TASK_SOFT | flags,
cb->cb_ops ? &nfsd4_cb_ops : &nfsd4_cb_probe_ops, cb);
ret = rpc_call_async(clnt, &cb->cb_msg, RPC_TASK_SOFT | flags,
cb->cb_ops ? &nfsd4_cb_ops : &nfsd4_cb_probe_ops, cb);
if (ret != 0) {
set_bit(NFSD4_CALLBACK_REQUEUE, &cb->cb_flags);
nfsd4_queue_cb(cb);
}
}

void nfsd4_init_cb(struct nfsd4_callback *cb, struct nfs4_client *clp,
Expand Down

0 comments on commit ff383e8

Please sign in to comment.