From: Sage Weil Date: Fri, 3 Feb 2017 14:23:44 +0000 (-0500) Subject: include/ceph_features: remove ceph_sanitize_features workaround X-Git-Tag: v12.0.1~467^2~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ff1959282826ae6acd7134e1b1ede74ffd1cc04a;p=ceph.git include/ceph_features: remove ceph_sanitize_features workaround Way back in 9ea02b84104045c2ffd7e7f4e7af512953855ecd we defined the SNAPMAPPER feature such that it set bits 32-63 by sign-extending a negative int32_t to int64_t. In 4255b5c2fb54ae40c53284b3ab700fdfc7e61748 it was fixed. This affected v0.58-657-g9ea02b8 to v0.65-263-g4255b5c. The workaround santized features whenever the top bit 63 was set to be the intended set of features (bits 0-32). Only buggy peers in that range ever set bit 63. Since these versions are truly ancient (pre-dumpling) and no clients should be that old, we are dropping the workaround. Note that the Linux kernel client never had this bug: 2b3e0c905af43cfe402a2ef3f800be5dc1684005 went from 30 bits used to 38 bits defiend with the workaround in place. We deprecate the bit now (i.e., stop paying attention to this bit). After another extended period of time we'll eventually be able to retire and reuse it. Signed-off-by: Sage Weil --- diff --git a/src/include/ceph_features.h b/src/include/ceph_features.h index f3841aeb0a2d..55c60a1e207b 100755 --- a/src/include/ceph_features.h +++ b/src/include/ceph_features.h @@ -161,31 +161,8 @@ DEFINE_CEPH_FEATURE(59, 1, MSG_ADDR2) // overlap DEFINE_CEPH_FEATURE(61, 1, RESERVED2) // unused, but slow down! DEFINE_CEPH_FEATURE(62, 1, RESERVED) // do not use; used as a sentinal -DEFINE_CEPH_FEATURE(63, 1, RESERVED_BROKEN) // do not use; see below +DEFINE_CEPH_FEATURE_DEPRECATED(63, 1, RESERVED_BROKEN, LUMINOUS) // client-facing -/* - * The introduction of CEPH_FEATURE_OSD_SNAPMAPPER caused the feature - * vector to evaluate to 64 bit ~0. To cope, we designate 1ULL << 63 - * to mean 33 bit ~0, and introduce a helper below to do the - * translation. - * - * This was introduced by commit - * 9ea02b84104045c2ffd7e7f4e7af512953855ecd v0.58-657-g9ea02b8 - * and fixed by commit - * 4255b5c2fb54ae40c53284b3ab700fdfc7e61748 v0.65-263-g4255b5c - * - * TODO: can we remove this workaround? (does it appear in any kernel?) - */ -#define CEPH_FEATURE_RESERVED_BROKEN (1ULL<<63) - -static inline unsigned long long ceph_sanitize_features(unsigned long long f) { - if (f & CEPH_FEATURE_RESERVED_BROKEN) { - /* everything through OSD_SNAPMAPPER */ - return 0x1ffffffffull; - } else { - return f; - } -} /* * Features supported. Should be everything above. @@ -277,7 +254,7 @@ static inline void ____build_time_check_for_reserved_bits(void) { CEPH_STATIC_ASSERT((CEPH_FEATURES_ALL & (CEPH_FEATURE_RESERVED | CEPH_FEATURE_RESERVED2 | - CEPH_FEATURE_RESERVED_BROKEN)) == 0); + DEPRECATED_CEPH_FEATURE_RESERVED_BROKEN)) == 0); } #endif diff --git a/src/msg/async/AsyncConnection.cc b/src/msg/async/AsyncConnection.cc index e489e79ab99f..c566dfe64c91 100644 --- a/src/msg/async/AsyncConnection.cc +++ b/src/msg/async/AsyncConnection.cc @@ -1074,7 +1074,7 @@ ssize_t AsyncConnection::_process_connection() } connect_reply = *((ceph_msg_connect_reply*)state_buffer); - connect_reply.features = ceph_sanitize_features(connect_reply.features); + connect_reply.features = connect_reply.features; ldout(async_msgr->cct, 20) << __func__ << " connect got reply tag " << (int)connect_reply.tag << " connect_seq " << connect_reply.connect_seq << " global_seq " @@ -1287,7 +1287,7 @@ ssize_t AsyncConnection::_process_connection() connect_msg = *((ceph_msg_connect*)state_buffer); // sanitize features - connect_msg.features = ceph_sanitize_features(connect_msg.features); + connect_msg.features = connect_msg.features; state = STATE_ACCEPTING_WAIT_CONNECT_MSG_AUTH; break; } diff --git a/src/msg/simple/Pipe.cc b/src/msg/simple/Pipe.cc index fb8bed2fa292..1b531675d866 100644 --- a/src/msg/simple/Pipe.cc +++ b/src/msg/simple/Pipe.cc @@ -428,7 +428,7 @@ int Pipe::accept() } // sanitize features - connect.features = ceph_sanitize_features(connect.features); + connect.features = connect.features; authorizer.clear(); if (connect.authorizer_len) { @@ -1149,7 +1149,7 @@ int Pipe::connect() } // sanitize features - reply.features = ceph_sanitize_features(reply.features); + reply.features = reply.features; ldout(msgr->cct,20) << "connect got reply tag " << (int)reply.tag << " connect_seq " << reply.connect_seq