From f84c8c45172b2715b88b986e1fa6d91dc80a4b8d Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" Date: Fri, 9 Sep 2011 11:54:57 -0400 Subject: [PATCH] --- yaml --- r: 267159 b: refs/heads/master c: 69064a2764fe195f1478be3ea83d15abe5d71025 h: refs/heads/master i: 267157: 810a7846196ecdf9284104623b0ee1973648ed1b 267155: 9429dc21ebc474886858abae36b9e3b9b4f0a733 267151: e2ef95ea3041bd8545ae066f8e5132b943d736cb v: v3 --- [refs] | 2 +- trunk/fs/nfsd/nfs4state.c | 24 ++++++++++-------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/[refs] b/[refs] index 8acb4caef49a..bc3da5869f44 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 97b7e3b6d4ae838694b43f66b4f0b32b5ec7635b +refs/heads/master: 69064a2764fe195f1478be3ea83d15abe5d71025 diff --git a/trunk/fs/nfsd/nfs4state.c b/trunk/fs/nfsd/nfs4state.c index 30387f3d9881..ea338d0c62a1 100644 --- a/trunk/fs/nfsd/nfs4state.c +++ b/trunk/fs/nfsd/nfs4state.c @@ -3290,6 +3290,7 @@ __be32 nfs4_preprocess_stateid_op(struct nfsd4_compound_state *cstate, stateid_t *stateid, int flags, struct file **filpp) { + struct nfs4_stid *s; struct nfs4_ol_stateid *stp = NULL; struct nfs4_delegation *dp = NULL; struct svc_fh *current_fh = &cstate->current_fh; @@ -3314,13 +3315,14 @@ nfs4_preprocess_stateid_op(struct nfsd4_compound_state *cstate, * but that we can't find, is expired: */ status = nfserr_expired; - if (is_delegation_stateid(stateid)) { - dp = find_deleg_stateid(stateid); - if (!dp) - goto out; - status = check_stateid_generation(stateid, &dp->dl_stid.sc_stateid, nfsd4_has_session(cstate)); - if (status) - goto out; + s = find_stateid(stateid); + if (!s) + goto out; + status = check_stateid_generation(stateid, &s->sc_stateid, nfsd4_has_session(cstate)); + if (status) + goto out; + if (s->sc_type == NFS4_DELEG_STID) { + dp = delegstateid(s); status = nfs4_check_delegmode(dp, flags); if (status) goto out; @@ -3330,19 +3332,13 @@ nfs4_preprocess_stateid_op(struct nfsd4_compound_state *cstate, BUG_ON(!*filpp); } } else { /* open or lock stateid */ - stp = find_ol_stateid(stateid); - if (!stp) - goto out; + stp = openlockstateid(s); status = nfserr_bad_stateid; if (nfs4_check_fh(current_fh, stp)) goto out; if (stp->st_stateowner->so_is_open_owner && !openowner(stp->st_stateowner)->oo_confirmed) goto out; - status = check_stateid_generation(stateid, &stp->st_stid.sc_stateid, - nfsd4_has_session(cstate)); - if (status) - goto out; status = nfs4_check_openmode(stp, flags); if (status) goto out;