diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2014-06-04 22:53:02 +0200 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-06-04 22:53:02 +0200 |
commit | f8647b506d7116a1a3accd8d618184096e85f50b (patch) | |
tree | f10bc7201fda2a36c035548a0ea62210ad57adb6 /fs/nfsd/nfs4state.c | |
parent | MIPS: IP22/IP28: Improve GIO support (diff) | |
parent | MIPS: Call find_vma with the mmap_sem held (diff) | |
download | linux-f8647b506d7116a1a3accd8d618184096e85f50b.tar.xz linux-f8647b506d7116a1a3accd8d618184096e85f50b.zip |
Merge branch '3.15-fixes' into mips-for-linux-next
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r-- | fs/nfsd/nfs4state.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 32b699bebb9c..9a77a5a21557 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -3717,9 +3717,16 @@ out: static __be32 nfsd4_free_lock_stateid(struct nfs4_ol_stateid *stp) { - if (check_for_locks(stp->st_file, lockowner(stp->st_stateowner))) + struct nfs4_lockowner *lo = lockowner(stp->st_stateowner); + + if (check_for_locks(stp->st_file, lo)) return nfserr_locks_held; - release_lock_stateid(stp); + /* + * Currently there's a 1-1 lock stateid<->lockowner + * correspondance, and we have to delete the lockowner when we + * delete the lock stateid: + */ + unhash_lockowner(lo); return nfs_ok; } @@ -4159,6 +4166,10 @@ static bool same_lockowner_ino(struct nfs4_lockowner *lo, struct inode *inode, c if (!same_owner_str(&lo->lo_owner, owner, clid)) return false; + if (list_empty(&lo->lo_owner.so_stateids)) { + WARN_ON_ONCE(1); + return false; + } lst = list_first_entry(&lo->lo_owner.so_stateids, struct nfs4_ol_stateid, st_perstateowner); return lst->st_file->fi_inode == inode; |