Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cf61eb26 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

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
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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:
+5 −0
Original line number Diff line number Diff line
@@ -407,6 +407,11 @@ static int nfs4_do_handle_exception(struct nfs_server *server,
	switch(errorcode) {
		case 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_ADMIN_REVOKED:
		case -NFS4ERR_EXPIRED: