Skip to content

Commit 714fbc7

Browse files
trondmyamschuma-ntap
authored andcommitted
SUNRPC: RPC level errors should always set task->tk_rpc_status
Ensure that we set task->tk_rpc_status for all RPC level errors so that the caller can distinguish between those and server reply status errors. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent 45835a6 commit 714fbc7

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

net/sunrpc/clnt.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,7 +1837,7 @@ call_allocate(struct rpc_task *task)
18371837
return;
18381838
}
18391839

1840-
rpc_exit(task, -ERESTARTSYS);
1840+
rpc_call_rpcerror(task, -ERESTARTSYS);
18411841
}
18421842

18431843
static int
@@ -2544,7 +2544,7 @@ rpc_encode_header(struct rpc_task *task, struct xdr_stream *xdr)
25442544
return 0;
25452545
out_fail:
25462546
trace_rpc_bad_callhdr(task);
2547-
rpc_exit(task, error);
2547+
rpc_call_rpcerror(task, error);
25482548
return error;
25492549
}
25502550

@@ -2611,7 +2611,7 @@ rpc_decode_header(struct rpc_task *task, struct xdr_stream *xdr)
26112611
return -EAGAIN;
26122612
}
26132613
out_err:
2614-
rpc_exit(task, error);
2614+
rpc_call_rpcerror(task, error);
26152615
return error;
26162616

26172617
out_unparsable:

net/sunrpc/sched.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,8 +911,10 @@ static void __rpc_execute(struct rpc_task *task)
911911
/*
912912
* Signalled tasks should exit rather than sleep.
913913
*/
914-
if (RPC_SIGNALLED(task))
914+
if (RPC_SIGNALLED(task)) {
915+
task->tk_rpc_status = -ERESTARTSYS;
915916
rpc_exit(task, -ERESTARTSYS);
917+
}
916918

917919
/*
918920
* The queue->lock protects against races with
@@ -948,6 +950,7 @@ static void __rpc_execute(struct rpc_task *task)
948950
*/
949951
dprintk("RPC: %5u got signal\n", task->tk_pid);
950952
set_bit(RPC_TASK_SIGNALLED, &task->tk_runstate);
953+
task->tk_rpc_status = -ERESTARTSYS;
951954
rpc_exit(task, -ERESTARTSYS);
952955
}
953956
dprintk("RPC: %5u sync task resuming\n", task->tk_pid);

0 commit comments

Comments
 (0)