]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: don't exclude disallowed caps when recording wanted caps
authorYan, Zheng <zyan@redhat.com>
Thu, 29 Nov 2018 03:00:59 +0000 (11:00 +0800)
committerPrashant D <pdhange@redhat.com>
Thu, 3 Jan 2019 01:06:01 +0000 (20:06 -0500)
Excluding caps (that replica inode disallows) make client and mds
have different view of wanted caps. It causes problem in some corner
cases of subtree migration.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Fixes: http://tracker.ceph.com/issues/37464
(cherry picked from commit 5a39f1d5c609fe86a9c12aaeaf925139fb56b5b1)

Conflicts:
src/mds/Locker.cc : Resolved in request_inode_file_caps

src/mds/Locker.cc

index 058fcae7642c5aa9fe89750b007b541fc3001126..3c263d68cc3f9d72209598ef007159206f52ad43 100644 (file)
@@ -2224,7 +2224,7 @@ void Locker::request_inode_file_caps(CInode *in)
 {
   assert(!in->is_auth());
 
-  int wanted = in->get_caps_wanted() & ~CEPH_CAP_PIN;
+  int wanted = in->get_caps_wanted() & in->get_caps_allowed_ever() & ~CEPH_CAP_PIN;
   if (wanted != in->replica_caps_wanted) {
     // wait for single auth
     if (in->is_ambiguous_auth()) {
@@ -2873,9 +2873,9 @@ void Locker::handle_client_caps(MClientCaps *m)
 
     // filter wanted based on what we could ever give out (given auth/replica status)
     bool need_flush = m->flags & CLIENT_CAPS_SYNC;
-    int new_wanted = m->get_wanted() & head_in->get_caps_allowed_ever();
+    int new_wanted = m->get_wanted();
     if (new_wanted != cap->wanted()) {
-      if (!need_flush && (new_wanted & ~cap->pending())) {
+      if (!need_flush && in->is_auth() && (new_wanted & ~cap->pending())) {
        // exapnding caps.  make sure we aren't waiting for a log flush
        need_flush = _need_flush_mdlog(head_in, new_wanted & ~cap->pending());
       }