Skip to content

Commit

Permalink
NFSv4: don't reprocess cached open CLAIM_PREVIOUS
Browse files Browse the repository at this point in the history
Cached opens have already been handled by _nfs4_opendata_reclaim_to_nfs4_state
and can safely skip being reprocessed, but must still call update_open_stateid
to make sure that all active fmodes are recovered.

Signed-off-by: Weston Andros Adamson <dros@netapp.com>
Cc: stable@vger.kernel.org # 3.7.x: f494a60: NFSv4: fix NULL dereference
Cc: stable@vger.kernel.org # 3.7.x: a43ec98: NFSv4: don't fail on missin
Cc: stable@vger.kernel.org # 3.7.x
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Weston Andros Adamson authored and Trond Myklebust committed Oct 28, 2013
1 parent d49f042 commit d2bfda2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1317,10 +1317,13 @@ _nfs4_opendata_reclaim_to_nfs4_state(struct nfs4_opendata *data)
struct nfs4_state *state = data->state;
int ret;

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

ret = nfs_refresh_inode(inode, &data->f_attr);
Expand All @@ -1329,6 +1332,7 @@ _nfs4_opendata_reclaim_to_nfs4_state(struct nfs4_opendata *data)

if (data->o_res.delegation_type != 0)
nfs4_opendata_check_deleg(data, state);
update:
update_open_stateid(state, &data->o_res.stateid, NULL,
data->o_arg.fmode);
atomic_inc(&state->count);
Expand Down

0 comments on commit d2bfda2

Please sign in to comment.