]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/ceph/caps.c
ceph: fix cap revoke race
[karo-tx-linux.git] / fs / ceph / caps.c
index 16266f3e9a332fbfc9d3fc9d9203491b1ab99003..7045a8dfaad402b7f08d17e63a8a6d87064ec763 100644 (file)
@@ -690,6 +690,15 @@ int __ceph_caps_issued(struct ceph_inode_info *ci, int *implemented)
                if (implemented)
                        *implemented |= cap->implemented;
        }
+       /*
+        * exclude caps issued by non-auth MDS, but are been revoking
+        * by the auth MDS. The non-auth MDS should be revoking/exporting
+        * these caps, but the message is delayed.
+        */
+       if (ci->i_auth_cap) {
+               cap = ci->i_auth_cap;
+               have &= ~cap->implemented | cap->issued;
+       }
        return have;
 }