]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: issue all snap_caps allowed given locks, not by current cap
authorSage Weil <sage@newdream.net>
Fri, 9 Jul 2010 17:32:25 +0000 (10:32 -0700)
committerSage Weil <sage@newdream.net>
Fri, 9 Jul 2010 21:47:21 +0000 (14:47 -0700)
For snap_caps, who cares if the live inode has a cap for this client.  We
always want to issue the maximum set of caps the inode locks allow for
a live inode or snapped inode with caps, or the max caps ever for a snapped
inode without caps.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mds/CInode.cc

index a0a9d2fdd47f111f8f4076adee44fb6da88ed23c..3f3c494e505aa9f8a453c5423193be1f15228bcb 100644 (file)
@@ -1762,8 +1762,8 @@ int CInode::encode_inodestat(bufferlist& bl, Session *session,
      * multiversion.
      */
     e.cap.caps = valid ? get_caps_allowed_by_type(CAP_ANY) : CEPH_STAT_CAP_INODE;
-    if (cap)
-      e.cap.caps = e.cap.caps & cap->issued();
+    if (last == CEPH_NOSNAP || is_any_caps())
+      e.cap.caps = e.cap.caps & get_caps_allowed_for_client(client);
     e.cap.seq = 0;
     e.cap.mseq = 0;
     e.cap.realm = 0;