Skip to content

Commit

Permalink
client: always refresh mds feature bits on session open
Browse files Browse the repository at this point in the history
Fixes: http://tracker.ceph.com/issues/63188
Signed-off-by: Venky Shankar <vshankar@redhat.com>
  • Loading branch information
vshankar committed Oct 16, 2023
1 parent 4a426ea commit 33e8efc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/client/Client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2384,6 +2384,12 @@ void Client::_closed_mds_session(MetaSession *s, int err, bool rejected)
mds_sessions.erase(s->mds_num);
}

static void reinit_mds_features(MetaSession *session,
const MConstRef<MClientSession>& m) {
session->mds_features = std::move(m->supported_features);
session->mds_metric_flags = std::move(m->metric_spec.metric_flags);
}

void Client::handle_client_session(const MConstRef<MClientSession>& m)
{
mds_rank_t from = mds_rank_t(m->get_source().num());
Expand All @@ -2402,6 +2408,7 @@ void Client::handle_client_session(const MConstRef<MClientSession>& m)
if (session->state == MetaSession::STATE_OPEN) {
ldout(cct, 10) << "mds." << from << " already opened, ignore it"
<< dendl;
reinit_mds_features(session.get(), m);
return;
}
/*
Expand All @@ -2411,8 +2418,7 @@ void Client::handle_client_session(const MConstRef<MClientSession>& m)
if (!session->seq && m->get_seq())
session->seq = m->get_seq();

session->mds_features = std::move(m->supported_features);
session->mds_metric_flags = std::move(m->metric_spec.metric_flags);
reinit_mds_features(session.get(), m);
cap_auths = std::move(m->cap_auths);

renew_caps(session.get());
Expand Down

0 comments on commit 33e8efc

Please sign in to comment.