]> www.infradead.org Git - users/hch/misc.git/commitdiff
NFSv4: Fail mounts if the lease setup times out
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 9 Sep 2024 17:47:07 +0000 (13:47 -0400)
committerAnna Schumaker <anna.schumaker@oracle.com>
Mon, 23 Sep 2024 19:03:13 +0000 (15:03 -0400)
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>
fs/nfs/nfs4state.c

index 2ef656ca6371dbdad1821445ab47e8ad4f487f1c..581864a15888cc917e4cb9092d492e1aa2684f71 100644 (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: