From 589e6a42ca279c012627cfe4c66aa4af6c7c8e82 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Wed, 1 Nov 2023 14:59:30 +0800 Subject: [PATCH] client: switch to session's reference instead of constructing a new object This is for pacific only, because in higher version we have switched the mds_sessions map to a shared_ptr. Fixes: https://tracker.ceph.com/issues/63381 Signed-off-by: Xiubo Li --- src/client/Client.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 4bfe52f77c3..9bf5aa017b0 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -4817,7 +4817,7 @@ void Client::flush_caps_sync() { ldout(cct, 10) << __func__ << dendl; for (auto &q : mds_sessions) { - auto s = q.second; + auto &s = q.second; xlist::iterator p = s.dirty_list.begin(); while (!p.end()) { unsigned flags = CHECK_CAPS_NODELAY; @@ -6662,7 +6662,7 @@ void Client::_unmount(bool abort) if (abort || blocklisted) { for (auto &q : mds_sessions) { - auto s = q.second; + auto &s = q.second; for (auto p = s.dirty_list.begin(); !p.end(); ) { Inode *in = *p; ++p; -- 2.47.3