]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge 3.15 bugfixes for 3.16
authorJ. Bruce Fields <bfields@redhat.com>
Thu, 22 May 2014 19:48:11 +0000 (15:48 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 22 May 2014 19:48:15 +0000 (15:48 -0400)
fs/nfsd/nfs4acl.c
fs/nfsd/nfs4state.c

index 05c9b2f9427b712d97474219d8d88af9d65a374b..7c7c02554a81750e786a35cbaa89d87a3f009fcd 100644 (file)
@@ -589,7 +589,7 @@ posix_state_to_acl(struct posix_acl_state *state, unsigned int flags)
                add_to_mask(state, &state->groups->aces[i].perms);
        }
 
-       if (!state->users->n && !state->groups->n) {
+       if (state->users->n || state->groups->n) {
                pace++;
                pace->e_tag = ACL_MASK;
                low_mode_from_nfs4(state->mask.allow, &pace->e_perm, flags);
index c6ded9feaef967e5fcaa466e168565aff5764c7c..a037627ce5c7a56ab8558503964fc17152eea069 100644 (file)
@@ -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;