All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yan, Zheng" <zheng.z.yan@intel.com>
To: ceph-devel@vger.kernel.org
Cc: sage@inktank.com, "Yan, Zheng" <zheng.z.yan@intel.com>
Subject: [PATCH 6/6] mds: don't issue caps while session is stale
Date: Mon,  5 Aug 2013 14:10:27 +0800	[thread overview]
Message-ID: <1375683030-28305-7-git-send-email-zheng.z.yan@intel.com> (raw)
In-Reply-To: <1375683030-28305-1-git-send-email-zheng.z.yan@intel.com>

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 --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;
-- 
1.8.1.4


  parent reply	other threads:[~2013-08-05  6:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-05  6:10 [PATCH 0/6] misc fixes for mds Yan, Zheng
2013-08-05  6:10 ` [PATCH 1/6] mds: fix cap revoke confirmation Yan, Zheng
2013-08-05  6:10 ` [PATCH 2/6] mds: revoke GSHARED cap when finishing xlock Yan, Zheng
2013-08-05  6:10 ` [PATCH 3/6] mds: remove "type != CEPH_LOCK_DN" check in Locker::cancel_locking() Yan, Zheng
2013-08-05  6:10 ` [PATCH 4/6] mds: handle "state == LOCK_LOCK_XLOCK" when cancelling xlock Yan, Zheng
2013-08-05  6:10 ` [PATCH 5/6] mds: change LOCK_SCAN to unstable state Yan, Zheng
2013-08-05  6:10 ` Yan, Zheng [this message]
2013-08-05  6:10 ` [PATCH 1/3] ceph: introduce i_truncate_mutex Yan, Zheng
2013-08-05  6:10 ` [PATCH 2/3] ceph: fix request max size Yan, Zheng
2013-08-05  6:10 ` [PATCH 3/3] ceph: rework trim caps code Yan, Zheng
2013-08-23 20:27   ` Gregory Farnum
2013-08-23 20:37     ` Sage Weil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1375683030-28305-7-git-send-email-zheng.z.yan@intel.com \
    --to=zheng.z.yan@intel.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=sage@inktank.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.