From 3cbf578e5e4ec6a79c78fc18d9104d4e71aab014 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 9 Jul 2010 10:32:25 -0700 Subject: [PATCH] mds: issue all snap_caps allowed given locks, not by current cap 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 --- src/mds/CInode.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index a0a9d2fdd47f1..3f3c494e505aa 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -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; -- 2.39.5