diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-07-29 21:34:19 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-07-31 14:20:12 -0400 |
commit | d6f2bc5dcf58259b6c3f206ae8f14087300b5bcf (patch) | |
tree | f5aef39e98705f4bd1a5b2bb269e5675faf2de1c | |
parent | dcd94cc2e75cb1457d4d2dcfa0b360baee4b8764 (diff) |
nfsd: nfsd4_process_open2() must reference the open stateid
Ensure that nfsd4_process_open2() keeps a reference to the open
stateid until it is done working with it. Necessary step toward
client_mutex removal.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r-- | fs/nfsd/nfs4state.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 5cb6305036cd..f3018cb26769 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -2996,6 +2996,7 @@ alloc_init_open_stateowner(unsigned int strhashval, struct nfsd4_open *open, | |||
2996 | static void init_open_stateid(struct nfs4_ol_stateid *stp, struct nfs4_file *fp, struct nfsd4_open *open) { | 2996 | static void init_open_stateid(struct nfs4_ol_stateid *stp, struct nfs4_file *fp, struct nfsd4_open *open) { |
2997 | struct nfs4_openowner *oo = open->op_openowner; | 2997 | struct nfs4_openowner *oo = open->op_openowner; |
2998 | 2998 | ||
2999 | atomic_inc(&stp->st_stid.sc_count); | ||
2999 | stp->st_stid.sc_type = NFS4_OPEN_STID; | 3000 | stp->st_stid.sc_type = NFS4_OPEN_STID; |
3000 | INIT_LIST_HEAD(&stp->st_locks); | 3001 | INIT_LIST_HEAD(&stp->st_locks); |
3001 | stp->st_stateowner = &oo->oo_owner; | 3002 | stp->st_stateowner = &oo->oo_owner; |
@@ -3376,6 +3377,7 @@ nfsd4_find_existing_open(struct nfs4_file *fp, struct nfsd4_open *open) | |||
3376 | continue; | 3377 | continue; |
3377 | if (local->st_stateowner == &oo->oo_owner) { | 3378 | if (local->st_stateowner == &oo->oo_owner) { |
3378 | ret = local; | 3379 | ret = local; |
3380 | atomic_inc(&ret->st_stid.sc_count); | ||
3379 | break; | 3381 | break; |
3380 | } | 3382 | } |
3381 | } | 3383 | } |
@@ -3836,6 +3838,8 @@ out: | |||
3836 | open->op_rflags |= NFS4_OPEN_RESULT_CONFIRM; | 3838 | open->op_rflags |= NFS4_OPEN_RESULT_CONFIRM; |
3837 | if (dp) | 3839 | if (dp) |
3838 | nfs4_put_stid(&dp->dl_stid); | 3840 | nfs4_put_stid(&dp->dl_stid); |
3841 | if (stp) | ||
3842 | nfs4_put_stid(&stp->st_stid); | ||
3839 | 3843 | ||
3840 | return status; | 3844 | return status; |
3841 | } | 3845 | } |