From cf61eb268678c83eef812f937a3a9aeee67c460b Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Tue, 29 May 2018 22:06:08 -0400 Subject: NFSv4: Always clear the pNFS layout when handling ESTALE If we get an ESTALE error in response to an RPC call operating on the file on the MDS, we should immediately cancel the layout for that file. Signed-off-by: Trond Myklebust --- fs/nfs/nfs42proc.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fs/nfs/nfs42proc.c') diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index 4d4a3df28779..5f59b6f65a42 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -370,6 +370,10 @@ nfs42_layoutstat_done(struct rpc_task *task, void *calldata) switch (task->tk_status) { case 0: break; + case -NFS4ERR_BADHANDLE: + case -ESTALE: + pnfs_destroy_layout(NFS_I(inode)); + break; case -NFS4ERR_EXPIRED: case -NFS4ERR_ADMIN_REVOKED: case -NFS4ERR_DELEG_REVOKED: -- cgit v1.2.3-70-g09d2