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

Commit 272289a3 authored by Trond Myklebust's avatar Trond Myklebust Committed by Anna Schumaker
Browse files

NFSv4: nfs4_do_handle_exception() handle revoke/expiry of a single stateid



If we're not yet sure that all state has expired or been revoked, we
should try to do a minimal recovery on just the one stateid.

Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Tested-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 7f048831
Loading
Loading
Loading
Loading
+11 −7
Original line number Original line Diff line number Diff line
@@ -397,13 +397,23 @@ static int nfs4_do_handle_exception(struct nfs_server *server,
	exception->delay = 0;
	exception->delay = 0;
	exception->recovering = 0;
	exception->recovering = 0;
	exception->retry = 0;
	exception->retry = 0;

	if (stateid == NULL && state != NULL)
		stateid = &state->stateid;

	switch(errorcode) {
	switch(errorcode) {
		case 0:
		case 0:
			return 0;
			return 0;
		case -NFS4ERR_OPENMODE:
		case -NFS4ERR_DELEG_REVOKED:
		case -NFS4ERR_DELEG_REVOKED:
		case -NFS4ERR_ADMIN_REVOKED:
		case -NFS4ERR_ADMIN_REVOKED:
		case -NFS4ERR_EXPIRED:
		case -NFS4ERR_BAD_STATEID:
		case -NFS4ERR_BAD_STATEID:
			if (inode != NULL && stateid != NULL) {
				nfs_inode_find_state_and_recover(inode,
						stateid);
				goto wait_on_recovery;
			}
		case -NFS4ERR_OPENMODE:
			if (inode) {
			if (inode) {
				int err;
				int err;


@@ -422,12 +432,6 @@ static int nfs4_do_handle_exception(struct nfs_server *server,
			if (ret < 0)
			if (ret < 0)
				break;
				break;
			goto wait_on_recovery;
			goto wait_on_recovery;
		case -NFS4ERR_EXPIRED:
			if (state != NULL) {
				ret = nfs4_schedule_stateid_recovery(server, state);
				if (ret < 0)
					break;
			}
		case -NFS4ERR_STALE_STATEID:
		case -NFS4ERR_STALE_STATEID:
		case -NFS4ERR_STALE_CLIENTID:
		case -NFS4ERR_STALE_CLIENTID:
			nfs4_schedule_lease_recovery(clp);
			nfs4_schedule_lease_recovery(clp);