diff options
author | J. Bruce Fields <bfields@redhat.com> | 2014-05-22 15:48:11 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-05-22 15:48:15 -0400 |
commit | f35ea0d4b66b789e0edcea634238e9aa31924516 (patch) | |
tree | 2de32d027b8dab67153d7133f42c732c5d9e0ffe /fs/nfsd/nfs4state.c | |
parent | cbf7a75bc58a2458bd6e47476e47819ba3f40b00 (diff) | |
parent | 27b11428b7de097c42f205beabb1764f4365443b (diff) | |
download | op-kernel-dev-f35ea0d4b66b789e0edcea634238e9aa31924516.zip op-kernel-dev-f35ea0d4b66b789e0edcea634238e9aa31924516.tar.gz |
Merge 3.15 bugfixes for 3.16
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 c6ded9f..a037627 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -3716,9 +3716,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; } @@ -4158,6 +4165,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; |