diff options
author | Weston Andros Adamson <dros@netapp.com> | 2013-10-21 13:10:13 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-10-28 15:10:56 -0400 |
commit | d2bfda2e7aa036f90ccea610a657064b1e267913 (patch) | |
tree | d14bccd93fb38225f765a43492a0faa92a8ba134 | |
parent | d49f042aeec99c5f87160bb52dd52088b1051311 (diff) |
NFSv4: don't reprocess cached open CLAIM_PREVIOUS
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: f494a6071d3: NFSv4: fix NULL dereference
Cc: stable@vger.kernel.org # 3.7.x: a43ec98b72a: NFSv4: don't fail on missin
Cc: stable@vger.kernel.org # 3.7.x
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/nfs/nfs4proc.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index d3c4255be6e0..259f8beb96a3 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -1317,10 +1317,13 @@ _nfs4_opendata_reclaim_to_nfs4_state(struct nfs4_opendata *data) | |||
1317 | struct nfs4_state *state = data->state; | 1317 | struct nfs4_state *state = data->state; |
1318 | int ret; | 1318 | int ret; |
1319 | 1319 | ||
1320 | /* allow cached opens (!rpc_done && !rpc_status) */ | 1320 | if (!data->rpc_done) { |
1321 | if (!data->rpc_done && data->rpc_status) { | 1321 | if (data->rpc_status) { |
1322 | ret = data->rpc_status; | 1322 | ret = data->rpc_status; |
1323 | goto err; | 1323 | goto err; |
1324 | } | ||
1325 | /* cached opens have already been processed */ | ||
1326 | goto update; | ||
1324 | } | 1327 | } |
1325 | 1328 | ||
1326 | ret = nfs_refresh_inode(inode, &data->f_attr); | 1329 | ret = nfs_refresh_inode(inode, &data->f_attr); |
@@ -1329,6 +1332,7 @@ _nfs4_opendata_reclaim_to_nfs4_state(struct nfs4_opendata *data) | |||
1329 | 1332 | ||
1330 | if (data->o_res.delegation_type != 0) | 1333 | if (data->o_res.delegation_type != 0) |
1331 | nfs4_opendata_check_deleg(data, state); | 1334 | nfs4_opendata_check_deleg(data, state); |
1335 | update: | ||
1332 | update_open_stateid(state, &data->o_res.stateid, NULL, | 1336 | update_open_stateid(state, &data->o_res.stateid, NULL, |
1333 | data->o_arg.fmode); | 1337 | data->o_arg.fmode); |
1334 | atomic_inc(&state->count); | 1338 | atomic_inc(&state->count); |