NFSv4: Fail mounts if the lease setup times out

If the server is down when the client is trying to mount, so that the
calls to exchange_id or create_session fail, then we should allow the
mount system call to fail rather than hang and block other mount/umount
calls.

Reported-by: Oleksandr Tymoshenko <ovt@google.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
This commit is contained in:
Trond Myklebust 2024-09-09 13:47:07 -04:00 committed by Anna Schumaker
parent 03e02b9417
commit af94dca79b

View File

@ -2013,6 +2013,12 @@ static int nfs4_handle_reclaim_lease_error(struct nfs_client *clp, int status)
nfs_mark_client_ready(clp, -EPERM);
clear_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state);
return -EPERM;
case -ETIMEDOUT:
if (clp->cl_cons_state == NFS_CS_SESSION_INITING) {
nfs_mark_client_ready(clp, -EIO);
return -EIO;
}
fallthrough;
case -EACCES:
case -NFS4ERR_DELAY:
case -EAGAIN: