]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: properly evaluate unstable locks when evicting client 32073/head
authorYan, Zheng <zyan@redhat.com>
Tue, 12 Nov 2019 03:28:57 +0000 (11:28 +0800)
committerNathan Cutler <ncutler@suse.com>
Fri, 6 Dec 2019 13:21:17 +0000 (14:21 +0100)
make sure we call Locker::eval_gather() for inodes in 'to_eval' list.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Fixes: https://tracker.ceph.com/issues/42759
(cherry picked from commit 06f175f34dbec471e5c31b00f76ccce727f3ff3b)

src/mds/Locker.cc

index a7c68adf0d1a3f332049a06dfb237b68c95f86fc..c3c282b5fbb5a51c5bb453e94676e27968cb1fd8 100644 (file)
@@ -2155,6 +2155,7 @@ bool Locker::revoke_stale_caps(Session *session)
   // invalidate all caps
   session->inc_cap_gen();
 
+  bool ret = true;
   std::vector<CInode*> to_eval;
 
   for (auto p = session->caps.begin(); !p.end(); ) {
@@ -2171,8 +2172,10 @@ bool Locker::revoke_stale_caps(Session *session)
     if (!revoking)
       continue;
 
-    if (revoking & CEPH_CAP_ANY_WR)
-      return false;
+    if (revoking & CEPH_CAP_ANY_WR) {
+      ret = false;
+      break;
+    }
 
     int issued = cap->issued();
     CInode *in = cap->get_inode();
@@ -2207,7 +2210,7 @@ bool Locker::revoke_stale_caps(Session *session)
       request_inode_file_caps(in);
   }
 
-  return true;
+  return ret;
 }
 
 void Locker::resume_stale_caps(Session *session)