From: Xiubo Li Date: Wed, 19 Jul 2023 02:22:39 +0000 (+0800) Subject: client: move the Inode to new auth mds session when changing auth cap X-Git-Tag: v18.2.1~87^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ecc478b265f5ceeae169690af43ef6927206ded9;p=ceph-ci.git client: move the Inode to new auth mds session when changing auth cap When the auth cap changes we need to move the Inode to the new session's dirty cap list. Fixes: https://tracker.ceph.com/issues/56698 Signed-off-by: Xiubo Li (cherry picked from commit 8aafa4cd7b1c124f5139ca93591cff61da1d2965) --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 8a0033441ea..87c777746cb 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -4421,11 +4421,19 @@ void Client::add_update_cap(Inode *in, MetaSession *mds_session, uint64_t cap_id if (flags & CEPH_CAP_FLAG_AUTH) { if (in->auth_cap != &cap && (!in->auth_cap || ceph_seq_cmp(in->auth_cap->mseq, mseq) < 0)) { - if (in->auth_cap && in->flushing_cap_item.is_on_list()) { - ldout(cct, 10) << __func__ << " changing auth cap: " - << "add myself to new auth MDS' flushing caps list" << dendl; - adjust_session_flushing_caps(in, in->auth_cap->session, mds_session); + if (in->auth_cap) { + if (in->flushing_cap_item.is_on_list()) { + ldout(cct, 10) << __func__ << " changing auth cap: " + << "add myself to new auth MDS' flushing caps list" << dendl; + adjust_session_flushing_caps(in, in->auth_cap->session, mds_session); + } + if (in->dirty_cap_item.is_on_list()) { + ldout(cct, 10) << __func__ << " changing auth cap: " + << "add myself to new auth MDS' dirty caps list" << dendl; + mds_session->get_dirty_list().push_back(&in->dirty_cap_item); + } } + in->auth_cap = ∩ } }