[3/9] NFSv4: Handle NFS4ERR_DELAY correctly in return-on-close
diff mbox series

Message ID 20190909140104.78818-3-trond.myklebust@hammerspace.com
State New
Headers show
Series
  • [1/9] pNFS: Ensure we do clear the return-on-close layout stateid on fatal errors
Related show

Commit Message

Trond Myklebust Sept. 9, 2019, 2 p.m. UTC
If the server sends a NFS4ERR_DELAY, then allow the caller to retry.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
 fs/nfs/pnfs.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch
diff mbox series

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 8769422a12f5..6436047dc999 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1455,6 +1455,10 @@  int pnfs_roc_done(struct rpc_task *task, struct inode *inode,
 	case 0:
 		retval = 0;
 		break;
+	case -NFS4ERR_DELAY:
+		/* Let the caller handle the retry */
+		*ret = -NFS4ERR_NOMATCHING_LAYOUT;
+		return 0;
 	case -NFS4ERR_OLD_STATEID:
 		if (!nfs4_layoutreturn_refresh_stateid(&arg->stateid,
 					&arg->range, inode))