Skip to content

Commit 6f56971

Browse files
daimngoAnna Schumaker
authored andcommitted
SUNRPC: do not retry on EKEYEXPIRED when user TGT ticket expired
When a user TGT ticket expired, gssd returns EKEYEXPIRED to the RPC layer for the upcall to create the security context. The RPC layer then retries the upcall twice before returning the EKEYEXPIRED to the NFS layer. This results in three separate TCP connections to the NFS server being created by gssd for each RPC request. These connections are not used and left in TIME_WAIT state. Note that for RPC call that uses machine credential, gssd automatically renews the ticket. But for a regular user the ticket needs to be renewed by the user before access to the krb5 share is allowed. This patch removes the retries by RPC on EKEYEXPIRED so that these unused TCP connections are not created. Reproducer: $ kinit -l 1m $ sleep 65 $ cd /mnt/krb5share $ netstat -na |grep TIME_WAIT Signed-off-by: Dai Ngo <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 918b8e3 commit 6f56971

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/sunrpc/clnt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,13 +1862,13 @@ call_refreshresult(struct rpc_task *task)
18621862
fallthrough;
18631863
case -EAGAIN:
18641864
status = -EACCES;
1865-
fallthrough;
1866-
case -EKEYEXPIRED:
18671865
if (!task->tk_cred_retry)
18681866
break;
18691867
task->tk_cred_retry--;
18701868
trace_rpc_retry_refresh_status(task);
18711869
return;
1870+
case -EKEYEXPIRED:
1871+
break;
18721872
case -ENOMEM:
18731873
rpc_delay(task, HZ >> 4);
18741874
return;

0 commit comments

Comments
 (0)