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());
if (session->state == MetaSession::STATE_OPEN) {
ldout(cct, 10) << "mds." << from << " already opened, ignore it"
<< dendl;
+ // The MDS could send a client_session(open) message even when
+ // the session state is STATE_OPEN. Normally, its fine to
+ // ignore this message, but, if the MDS sent this message just
+ // after it got upgraded, the MDS feature bits could differ
+ // than the one before the upgrade - so, refresh the feature
+ // bits the client holds.
+ reinit_mds_features(session.get(), m);
return;
}
/*
_closed_mds_session(session.get(), -CEPHFS_EPERM, true);
break;
}
- 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);
renew_caps(session.get());
session->state = MetaSession::STATE_OPEN;