Sfoglia il codice sorgente

NFSv4: Retry NFS4ERR_OLD_STATEID errors in layoutreturn

If our layoutreturn returns an NFS4ERR_OLD_STATEID, then try to
update the stateid and retry.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Trond Myklebust 8 anni fa
parent
commit
ff90514ebf
1 ha cambiato i file con 12 aggiunte e 3 eliminazioni
  1. 12 3
      fs/nfs/nfs4proc.c

+ 12 - 3
fs/nfs/nfs4proc.c

@@ -8750,18 +8750,27 @@ static void nfs4_layoutreturn_done(struct rpc_task *task, void *calldata)
 
 
 	server = NFS_SERVER(lrp->args.inode);
 	server = NFS_SERVER(lrp->args.inode);
 	switch (task->tk_status) {
 	switch (task->tk_status) {
+	case -NFS4ERR_OLD_STATEID:
+		if (nfs4_refresh_layout_stateid(&lrp->args.stateid,
+					lrp->args.inode))
+			goto out_restart;
+		/* Fallthrough */
 	default:
 	default:
 		task->tk_status = 0;
 		task->tk_status = 0;
+		/* Fallthrough */
 	case 0:
 	case 0:
 		break;
 		break;
 	case -NFS4ERR_DELAY:
 	case -NFS4ERR_DELAY:
 		if (nfs4_async_handle_error(task, server, NULL, NULL) != -EAGAIN)
 		if (nfs4_async_handle_error(task, server, NULL, NULL) != -EAGAIN)
 			break;
 			break;
-		nfs4_sequence_free_slot(&lrp->res.seq_res);
-		rpc_restart_call_prepare(task);
-		return;
+		goto out_restart;
 	}
 	}
 	dprintk("<-- %s\n", __func__);
 	dprintk("<-- %s\n", __func__);
+	return;
+out_restart:
+	task->tk_status = 0;
+	nfs4_sequence_free_slot(&lrp->res.seq_res);
+	rpc_restart_call_prepare(task);
 }
 }
 
 
 static void nfs4_layoutreturn_release(void *calldata)
 static void nfs4_layoutreturn_release(void *calldata)