aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index fbde6f79922e..aa309aa93fe8 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -397,10 +397,13 @@ static void unhash_generic_stateid(struct nfs4_stateid *stp)
397 397
398static void free_generic_stateid(struct nfs4_stateid *stp) 398static void free_generic_stateid(struct nfs4_stateid *stp)
399{ 399{
400 int oflag = nfs4_access_bmap_to_omode(stp); 400 int oflag;
401 401
402 nfs4_file_put_access(stp->st_file, oflag); 402 if (stp->st_access_bmap) {
403 put_nfs4_file(stp->st_file); 403 oflag = nfs4_access_bmap_to_omode(stp);
404 nfs4_file_put_access(stp->st_file, oflag);
405 put_nfs4_file(stp->st_file);
406 }
404 kmem_cache_free(stateid_slab, stp); 407 kmem_cache_free(stateid_slab, stp);
405} 408}
406 409
@@ -3055,7 +3058,7 @@ check_special_stateids(svc_fh *current_fh, stateid_t *stateid, int flags)
3055 if (ONE_STATEID(stateid) && (flags & RD_STATE)) 3058 if (ONE_STATEID(stateid) && (flags & RD_STATE))
3056 return nfs_ok; 3059 return nfs_ok;
3057 else if (locks_in_grace()) { 3060 else if (locks_in_grace()) {
3058 /* Answer in remaining cases depends on existance of 3061 /* Answer in remaining cases depends on existence of
3059 * conflicting state; so we must wait out the grace period. */ 3062 * conflicting state; so we must wait out the grace period. */
3060 return nfserr_grace; 3063 return nfserr_grace;
3061 } else if (flags & WR_STATE) 3064 } else if (flags & WR_STATE)
@@ -3675,7 +3678,7 @@ find_lockstateowner_str(struct inode *inode, clientid_t *clid,
3675/* 3678/*
3676 * Alloc a lock owner structure. 3679 * Alloc a lock owner structure.
3677 * Called in nfsd4_lock - therefore, OPEN and OPEN_CONFIRM (if needed) has 3680 * Called in nfsd4_lock - therefore, OPEN and OPEN_CONFIRM (if needed) has
3678 * occured. 3681 * occurred.
3679 * 3682 *
3680 * strhashval = lock_ownerstr_hashval 3683 * strhashval = lock_ownerstr_hashval
3681 */ 3684 */