diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-03-27 18:31:25 -0400 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2015-05-09 23:16:36 +0100 |
commit | 1c93477d29dc3be2ef6d68547c114bf2897af4d5 (patch) | |
tree | 1b068392ff7f5e8364848f732433a66122f9ed07 /fs | |
parent | d29f1f53e5299e0bbb3e33ef8d35ed657fa633b6 (diff) | |
download | linux-stable-1c93477d29dc3be2ef6d68547c114bf2897af4d5.tar.gz linux-stable-1c93477d29dc3be2ef6d68547c114bf2897af4d5.tar.bz2 linux-stable-1c93477d29dc3be2ef6d68547c114bf2897af4d5.zip |
NFSv4: Minor cleanups for nfs4_handle_exception and nfs4_async_handle_error
commit 14977489ffdb80d4caf5a184ba41b23b02fbacd9 upstream.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
[bwh: This is not merely a cleanup but also fixes a regression introduced by
commit 3114ea7a24d3 ("NFSv4: Return the delegation if the server returns
NFS4ERR_OPENMODE"), backported in 3.2.14]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/nfs4proc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 351989e97816..e83786f9905b 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -267,7 +267,7 @@ static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struc case 0: return 0; case -NFS4ERR_OPENMODE: - if (nfs_have_delegation(inode, FMODE_READ)) { + if (inode && nfs_have_delegation(inode, FMODE_READ)) { nfs_inode_return_delegation(inode); exception->retry = 1; return 0; @@ -279,10 +279,9 @@ static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struc case -NFS4ERR_DELEG_REVOKED: case -NFS4ERR_ADMIN_REVOKED: case -NFS4ERR_BAD_STATEID: - if (state != NULL) - nfs_remove_bad_delegation(state->inode); if (state == NULL) break; + nfs_remove_bad_delegation(state->inode); nfs4_schedule_stateid_recovery(server, state); goto wait_on_recovery; case -NFS4ERR_EXPIRED: @@ -3746,8 +3745,9 @@ nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server, case -NFS4ERR_DELEG_REVOKED: case -NFS4ERR_ADMIN_REVOKED: case -NFS4ERR_BAD_STATEID: - if (state != NULL) - nfs_remove_bad_delegation(state->inode); + if (state == NULL) + break; + nfs_remove_bad_delegation(state->inode); case -NFS4ERR_OPENMODE: if (state == NULL) break; |