From: Yan, Zheng Date: Thu, 29 Nov 2018 03:00:59 +0000 (+0800) Subject: mds: don't exclude disallowed caps when recording wanted caps X-Git-Tag: v12.2.11~21^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e35d01ff34a9fb28222fe25a0fb3e97f5b483853;p=ceph.git mds: don't exclude disallowed caps when recording wanted caps 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" Fixes: http://tracker.ceph.com/issues/37464 (cherry picked from commit 5a39f1d5c609fe86a9c12aaeaf925139fb56b5b1) Conflicts: src/mds/Locker.cc : Resolved in request_inode_file_caps --- diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 058fcae7642c..3c263d68cc3f 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -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()); }