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: v19.0.0~649^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8aafa4cd7b1c124f5139ca93591cff61da1d2965;p=ceph.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 --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 6a68ce81c7d..083a82d11a7 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -4467,11 +4467,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 = ∩ } }