diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2024-09-09 19:47:07 +0200 |
---|---|---|
committer | Anna Schumaker <anna.schumaker@oracle.com> | 2024-09-23 21:03:13 +0200 |
commit | af94dca79b1296a6db7b8b47cd43be8e94fce8bb (patch) | |
tree | 16202eeb2a74430f1e30ca61324702b8880a1bc4 | |
parent | fs: nfs: fix missing refcnt by replacing folio_set_private by folio_attach_pr... (diff) | |
download | linux-af94dca79b1296a6db7b8b47cd43be8e94fce8bb.tar.xz linux-af94dca79b1296a6db7b8b47cd43be8e94fce8bb.zip |
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>
-rw-r--r-- | fs/nfs/nfs4state.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 2ef656ca6371..581864a15888 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -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: |