Skip to content

Commit

Permalink
NFS: Return errors directly in _nfs4_opendata_reclaim_to_nfs4_state()
Browse files Browse the repository at this point in the history
There is no need for a goto just to return an error code without any
cleanup.  Returning the error directly helps to clean up the code.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
  • Loading branch information
Anna Schumaker authored and Anna Schumaker committed Jan 30, 2017
1 parent 820bf85 commit 37a8484
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1639,17 +1639,15 @@ _nfs4_opendata_reclaim_to_nfs4_state(struct nfs4_opendata *data)
int ret;

if (!data->rpc_done) {
if (data->rpc_status) {
ret = data->rpc_status;
goto err;
}
if (data->rpc_status)
return ERR_PTR(data->rpc_status);
/* cached opens have already been processed */
goto update;
}

ret = nfs_refresh_inode(inode, &data->f_attr);
if (ret)
goto err;
return ERR_PTR(ret);

if (data->o_res.delegation_type != 0)
nfs4_opendata_check_deleg(data, state);
Expand All @@ -1659,9 +1657,6 @@ _nfs4_opendata_reclaim_to_nfs4_state(struct nfs4_opendata *data)
atomic_inc(&state->count);

return state;
err:
return ERR_PTR(ret);

}

static struct nfs4_state *
Expand Down

0 comments on commit 37a8484

Please sign in to comment.