Skip to contentSkip to conversation

NFSv4: Schedule recovery if nfs40_walk_client_list() is interrupted

PATCH In review Trond Myklebust 2 participants 4 messages Mar 18, 2014 – Mar 19, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 NFSv4: Schedule recovery if nfs40_walk_client_list() is interrupted

If a timeout or a signal interrupts the NFSv4 trunking discovery SETCLIENTID_CONFIRM call, then we don't know whether or not the server has changed the callback identifier on us. Assume that it did, and schedule a 'path down' recovery...

---
 fs/nfs/nfs4client.c | 7 +++++++
 1 file changed, 7 insertions(+)
fs/nfs/nfs4client.c +7 -0
index 0e46d3d1b6cc..aa9ef4876046 100644
@@ -531,6 +531,13 @@ int nfs40_walk_client_list(struct nfs_client *new,
 			*result = pos;
 			dprintk("NFS: <-- %s using nfs_client = %p ({%d})\n",
 				__func__, pos, atomic_read(&pos->cl_count));
+			goto out;
+		case -ERESTARTSYS:
+		case -ETIMEDOUT:
+			/* The callback path may have been inadvertently
+			 * changed. Schedule recovery!
+			 */
+			nfs4_schedule_path_down_recovery(pos);
 		default:
 			goto out;
 		}
Signature · 1 line
1.8.5.3
#1 lore raw

PATCH 2/2 NFSv4: Ensure we respect soft mount timeouts during trunking discovery

---
 fs/nfs/nfs4state.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/nfs/nfs4state.c +3 -1
index f544a1560c83..2349518eef2c 100644
@@ -2075,8 +2075,10 @@ again:
 	switch (status) {
 	case 0:
 		break;
-	case -NFS4ERR_DELAY:
 	case -ETIMEDOUT:
+		if (clnt->cl_softrtry)
+			break;
+	case -NFS4ERR_DELAY:
 	case -EAGAIN:
 		ssleep(1);
 	case -NFS4ERR_STALE_CLIENTID:
Signature · 1 line
1.8.5.3
Tested-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] NFSv4: Ensure we respect soft mount timeouts during trunking discovery

Quoted 1 line · Trond Myklebust

steved.

Quoted 21 lines
---
 fs/nfs/nfs4state.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/nfs/nfs4state.c +3 -1
index f544a1560c83..2349518eef2c 100644
@@ -2075,8 +2075,10 @@ again:
 	switch (status) {
 	case 0:
 		break;
-	case -NFS4ERR_DELAY:
 	case -ETIMEDOUT:
+		if (clnt->cl_softrtry)
+			break;
+	case -NFS4ERR_DELAY:
 	case -EAGAIN:
 		ssleep(1);
 	case -NFS4ERR_STALE_CLIENTID:
Tested-by on v1 1/2
#3 lore raw
In reply to Trond Myklebust
Quoted 6 lines · Trond Myklebust

If a timeout or a signal interrupts the NFSv4 trunking discovery SETCLIENTID_CONFIRM call, then we don't know whether or not the server has changed the callback identifier on us. Assume that it did, and schedule a 'path down' recovery...

steved.

Quoted 23 lines
---
 fs/nfs/nfs4client.c | 7 +++++++
 1 file changed, 7 insertions(+)
fs/nfs/nfs4client.c +7 -0
index 0e46d3d1b6cc..aa9ef4876046 100644
@@ -531,6 +531,13 @@ int nfs40_walk_client_list(struct nfs_client *new,
 			*result = pos;
 			dprintk("NFS: <-- %s using nfs_client = %p ({%d})\n",
 				__func__, pos, atomic_read(&pos->cl_count));
+			goto out;
+		case -ERESTARTSYS:
+		case -ETIMEDOUT:
+			/* The callback path may have been inadvertently
+			 * changed. Schedule recovery!
+			 */
+			nfs4_schedule_path_down_recovery(pos);
 		default:
 			goto out;
 		}