X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=fs%2Fnfsd%2Fnfs4state.c;h=e98f3c2e9492a9d2dd3e86e6e443e924c9f04187;hb=a74d70b63f1a0230831bcca3145d85ae016f9d4c;hp=a8e4e91587ab1a9df5e8126a94b15b1705d70544;hpb=c47d832bc0155153920e507f075647519bad09a2;p=cascardo%2Flinux.git diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index a8e4e91587ab..e98f3c2e9492 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -258,6 +258,7 @@ static void nfs4_put_deleg_lease(struct nfs4_file *fp) if (atomic_dec_and_test(&fp->fi_delegees)) { vfs_setlease(fp->fi_deleg_file, F_UNLCK, &fp->fi_lease); fp->fi_lease = NULL; + fput(fp->fi_deleg_file); fp->fi_deleg_file = NULL; } } @@ -397,9 +398,12 @@ static void unhash_generic_stateid(struct nfs4_stateid *stp) static void free_generic_stateid(struct nfs4_stateid *stp) { - int oflag = nfs4_access_bmap_to_omode(stp); + int oflag; - nfs4_file_put_access(stp->st_file, oflag); + if (stp->st_access_bmap) { + oflag = nfs4_access_bmap_to_omode(stp); + nfs4_file_put_access(stp->st_file, oflag); + } put_nfs4_file(stp->st_file); kmem_cache_free(stateid_slab, stp); } @@ -3079,7 +3083,7 @@ check_special_stateids(svc_fh *current_fh, stateid_t *stateid, int flags) if (ONE_STATEID(stateid) && (flags & RD_STATE)) return nfs_ok; else if (locks_in_grace()) { - /* Answer in remaining cases depends on existance of + /* Answer in remaining cases depends on existence of * conflicting state; so we must wait out the grace period. */ return nfserr_grace; } else if (flags & WR_STATE) @@ -3699,7 +3703,7 @@ find_lockstateowner_str(struct inode *inode, clientid_t *clid, /* * Alloc a lock owner structure. * Called in nfsd4_lock - therefore, OPEN and OPEN_CONFIRM (if needed) has - * occured. + * occurred. * * strhashval = lock_ownerstr_hashval */