diff mbox

[6/6] mds: don't issue caps while session is stale

Message ID 1375683030-28305-7-git-send-email-zheng.z.yan@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yan, Zheng Aug. 5, 2013, 6:10 a.m. UTC
From: "Yan, Zheng" <zheng.z.yan@intel.com>

Locker::issue_caps() does not issue new caps to stale client,
CInode::encode_inodestat() should have the same logical.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
---
 src/mds/CInode.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc
index d215d18..dd48326 100644
--- a/src/mds/CInode.cc
+++ b/src/mds/CInode.cc
@@ -2733,10 +2733,12 @@  int CInode::encode_inodestat(bufferlist& bl, Session *session,
 
   // do not issue caps if inode differs from readdir snaprealm
   SnapRealm *realm = find_snaprealm();
-  bool no_caps = (realm && dir_realm && realm != dir_realm) ||
+  bool no_caps = session->is_stale() ||
+		 (realm && dir_realm && realm != dir_realm) ||
 		 is_frozen() || state_test(CInode::STATE_EXPORTINGCAPS);
   if (no_caps)
     dout(20) << "encode_inodestat no caps"
+	     << (session->is_stale()?", session stale ":"")
 	     << ((realm && dir_realm && realm != dir_realm)?", snaprealm differs ":"")
 	     << (state_test(CInode::STATE_EXPORTINGCAPS)?", exporting caps":"")
 	     << (is_frozen()?", frozen inode":"") << dendl;