Skip to contentSkip to conversation

NFSv4.1: handle NFS4ERR_NOSPC by CREATE_SESSION

PATCH Superseded Olga Kornievskaia 2 participants 2 messages Nov 15, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NFSv4.1: handle NFS4ERR_NOSPC by CREATE_SESSION

From: Olga Kornievskaia <[email protected]>

When the client receives ERR_NOSPC on reply to CREATE_SESSION it leads to a client hanging in nfs_wait_client_init_complete(). Instead, complete and fail the client initiation with an EIO error which allows for the mount command to fail instead of hanging.

---
 fs/nfs/nfs4state.c | 4 ++++
 1 file changed, 4 insertions(+)
fs/nfs/nfs4state.c +4 -0
index ecc4594299d6..50fa963665ba 100644
@@ -1998,6 +1998,10 @@ static int nfs4_handle_reclaim_lease_error(struct nfs_client *clp, int status)
 		dprintk("%s: exit with error %d for server %s\n",
 				__func__, -EPROTONOSUPPORT, clp->cl_hostname);
 		return -EPROTONOSUPPORT;
+	case -NFS4ERR_NOSPC:
+		if (clp->cl_cons_state == NFS_CS_SESSION_INITING)
+			nfs_mark_client_ready(clp, -EIO);
+		return -EIO;
 	case -NFS4ERR_NOT_SAME: /* FixMe: implement recovery
 				 * in nfs4_exchange_id */
 	default:
Signature · 1 line
2.27.0
#1 lore raw
Quoted 21 lines · Olga Kornievskaia

From: Olga Kornievskaia <[email protected]>

When the client receives ERR_NOSPC on reply to CREATE_SESSION it leads to a client hanging in nfs_wait_client_init_complete(). Instead, complete and fail the client initiation with an EIO error which allows for the mount command to fail instead of hanging.

---
 fs/nfs/nfs4state.c | 4 ++++

 1 file changed, 4 insertions(+)
fs/nfs/nfs4state.c +0 -0
index ecc4594299d6..50fa963665ba 100644
@@ -1998,6 +1998,10 @@ static int
 nfs4_handle_reclaim_lease_error(struct nfs_client *clp, int status)
                 dprintk("%s: exit with error %d for server %s\n",

                                __func__, -EPROTONOSUPPORT, clp-

Quoted 3 lines
Quoted 1 line

cl_hostname);

                return -EPROTONOSUPPORT;
+       case -NFS4ERR_NOSPC:

Shouldn't this be 'case -ENOSPC:'?

Quoted 6 lines

+               if (clp->cl_cons_state == NFS_CS_SESSION_INITING) +                       nfs_mark_client_ready(clp, -EIO); +               return -EIO;
        case -NFS4ERR_NOT_SAME: /* FixMe: implement recovery
                                 * in nfs4_exchange_id */ default:

Signature · 3 lines
Trond Myklebust
Linux NFS client maintainer, Hammerspace
[email protected]