Skip to content

Commit ff383e8

Browse files
jtlaytonchucklever
authored andcommitted
nfsd: handle errors from rpc_call_async()
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>
1 parent 32ce62c commit ff383e8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

fs/nfsd/nfs4callback.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,7 +1592,7 @@ nfsd4_run_cb_work(struct work_struct *work)
15921592
container_of(work, struct nfsd4_callback, cb_work);
15931593
struct nfs4_client *clp = cb->cb_clp;
15941594
struct rpc_clnt *clnt;
1595-
int flags;
1595+
int flags, ret;
15961596

15971597
trace_nfsd_cb_start(clp);
15981598

@@ -1625,8 +1625,12 @@ nfsd4_run_cb_work(struct work_struct *work)
16251625

16261626
cb->cb_msg.rpc_cred = clp->cl_cb_cred;
16271627
flags = clp->cl_minorversion ? RPC_TASK_NOCONNECT : RPC_TASK_SOFTCONN;
1628-
rpc_call_async(clnt, &cb->cb_msg, RPC_TASK_SOFT | flags,
1629-
cb->cb_ops ? &nfsd4_cb_ops : &nfsd4_cb_probe_ops, cb);
1628+
ret = rpc_call_async(clnt, &cb->cb_msg, RPC_TASK_SOFT | flags,
1629+
cb->cb_ops ? &nfsd4_cb_ops : &nfsd4_cb_probe_ops, cb);
1630+
if (ret != 0) {
1631+
set_bit(NFSD4_CALLBACK_REQUEUE, &cb->cb_flags);
1632+
nfsd4_queue_cb(cb);
1633+
}
16301634
}
16311635

16321636
void nfsd4_init_cb(struct nfsd4_callback *cb, struct nfs4_client *clp,

0 commit comments

Comments
 (0)