in previous change, MDSMap::min_compat_client was changed from int8_t to
ceph_release_t, i.e. uint8_t, and in
Server::update_required_client_features(), we check the
MDSMap::min_compat_client to see if it is greater than given version, so
a negative "-1" would overflow and be interpreted as a 255, hence will
be always greater than whatever version is compared. so we need to
bump up the encoding version, and
* normalize the number if it is -1
* ignore the number which is way too large.
Signed-off-by: Kefu Chai <kchai@redhat.com>
encode(cas_pool, bl);
// kclient ignores everything from here
- __u16 ev = 14;
+ __u16 ev = 15;
encode(ev, bl);
encode(compat, bl);
encode(metadata_pool, bl);
decode(old_max_mds, p);
}
- if (ev >= 14) {
+ if (ev == 14) {
+ int8_t r;
+ decode(r, p);
+ if (r < 0) {
+ min_compat_client = ceph_release_t::unknown;
+ } else {
+ min_compat_client = ceph_release_t{static_cast<uint8_t>(r)};
+ }
+ } else if (ev > 14) {
decode(min_compat_client, p);
}
if (objecter->get_client_incarnation() != incarnation)
objecter->set_client_incarnation(incarnation);
- if (oldmap.get_min_compat_client() != mdsmap->get_min_compat_client())
+ if (mdsmap->get_min_compat_client() < ceph_release_t::max &&
+ oldmap.get_min_compat_client() != mdsmap->get_min_compat_client())
server->update_required_client_features();
// for debug