Commit cf61eb26 authored by Trond Myklebust's avatar Trond Myklebust

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: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent d6889480
...@@ -370,6 +370,10 @@ nfs42_layoutstat_done(struct rpc_task *task, void *calldata) ...@@ -370,6 +370,10 @@ nfs42_layoutstat_done(struct rpc_task *task, void *calldata)
switch (task->tk_status) { switch (task->tk_status) {
case 0: case 0:
break; break;
case -NFS4ERR_BADHANDLE:
case -ESTALE:
pnfs_destroy_layout(NFS_I(inode));
break;
case -NFS4ERR_EXPIRED: case -NFS4ERR_EXPIRED:
case -NFS4ERR_ADMIN_REVOKED: case -NFS4ERR_ADMIN_REVOKED:
case -NFS4ERR_DELEG_REVOKED: case -NFS4ERR_DELEG_REVOKED:
......
...@@ -407,6 +407,11 @@ static int nfs4_do_handle_exception(struct nfs_server *server, ...@@ -407,6 +407,11 @@ static int nfs4_do_handle_exception(struct nfs_server *server,
switch(errorcode) { switch(errorcode) {
case 0: case 0:
return 0; return 0;
case -NFS4ERR_BADHANDLE:
case -ESTALE:
if (inode != NULL && S_ISREG(inode->i_mode))
pnfs_destroy_layout(NFS_I(inode));
break;
case -NFS4ERR_DELEG_REVOKED: case -NFS4ERR_DELEG_REVOKED:
case -NFS4ERR_ADMIN_REVOKED: case -NFS4ERR_ADMIN_REVOKED:
case -NFS4ERR_EXPIRED: case -NFS4ERR_EXPIRED:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment