]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: don't issue caps while session is stale
authorYan, Zheng <zheng.z.yan@intel.com>
Thu, 25 Jul 2013 04:33:51 +0000 (12:33 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Mon, 5 Aug 2013 03:09:07 +0000 (11:09 +0800)
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

index d215d18690f67dc2c9da0d1c973a287163ae39fe..dd483263b6dc26a7b9d81c5a420331a368ab673c 100644 (file)
@@ -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;