Commit 1c93477d authored by Trond Myklebust's avatar Trond Myklebust Committed by Ben Hutchings

NFSv4: Minor cleanups for nfs4_handle_exception and nfs4_async_handle_error

commit 14977489 upstream.
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
[bwh: This is not merely a cleanup but also fixes a regression introduced by
 commit 3114ea7a ("NFSv4: Return the delegation if the server returns
 NFS4ERR_OPENMODE"), backported in 3.2.14]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent d29f1f53
...@@ -267,7 +267,7 @@ static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struc ...@@ -267,7 +267,7 @@ static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struc
case 0: case 0:
return 0; return 0;
case -NFS4ERR_OPENMODE: case -NFS4ERR_OPENMODE:
if (nfs_have_delegation(inode, FMODE_READ)) { if (inode && nfs_have_delegation(inode, FMODE_READ)) {
nfs_inode_return_delegation(inode); nfs_inode_return_delegation(inode);
exception->retry = 1; exception->retry = 1;
return 0; return 0;
...@@ -279,10 +279,9 @@ static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struc ...@@ -279,10 +279,9 @@ static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struc
case -NFS4ERR_DELEG_REVOKED: case -NFS4ERR_DELEG_REVOKED:
case -NFS4ERR_ADMIN_REVOKED: case -NFS4ERR_ADMIN_REVOKED:
case -NFS4ERR_BAD_STATEID: case -NFS4ERR_BAD_STATEID:
if (state != NULL)
nfs_remove_bad_delegation(state->inode);
if (state == NULL) if (state == NULL)
break; break;
nfs_remove_bad_delegation(state->inode);
nfs4_schedule_stateid_recovery(server, state); nfs4_schedule_stateid_recovery(server, state);
goto wait_on_recovery; goto wait_on_recovery;
case -NFS4ERR_EXPIRED: case -NFS4ERR_EXPIRED:
...@@ -3746,8 +3745,9 @@ nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server, ...@@ -3746,8 +3745,9 @@ nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server,
case -NFS4ERR_DELEG_REVOKED: case -NFS4ERR_DELEG_REVOKED:
case -NFS4ERR_ADMIN_REVOKED: case -NFS4ERR_ADMIN_REVOKED:
case -NFS4ERR_BAD_STATEID: case -NFS4ERR_BAD_STATEID:
if (state != NULL) if (state == NULL)
nfs_remove_bad_delegation(state->inode); break;
nfs_remove_bad_delegation(state->inode);
case -NFS4ERR_OPENMODE: case -NFS4ERR_OPENMODE:
if (state == NULL) if (state == NULL)
break; break;
......
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