From: Yan, Zheng Date: Tue, 12 Nov 2019 03:28:57 +0000 (+0800) Subject: mds: properly evaluate unstable locks when evicting client X-Git-Tag: v14.2.8~20^2~26^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=91ecede104df24451ee9d7c8ebf15a9500383ef5;p=ceph.git mds: properly evaluate unstable locks when evicting client make sure we call Locker::eval_gather() for inodes in 'to_eval' list. Signed-off-by: "Yan, Zheng" Fixes: https://tracker.ceph.com/issues/42759 (cherry picked from commit 06f175f34dbec471e5c31b00f76ccce727f3ff3b) --- diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index a7c68adf0d1..c3c282b5fbb 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -2155,6 +2155,7 @@ bool Locker::revoke_stale_caps(Session *session) // invalidate all caps session->inc_cap_gen(); + bool ret = true; std::vector 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)