]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
include/ceph_features: remove ceph_sanitize_features workaround
authorSage Weil <sage@redhat.com>
Fri, 3 Feb 2017 14:23:44 +0000 (09:23 -0500)
committerSage Weil <sage@redhat.com>
Mon, 6 Feb 2017 20:43:50 +0000 (15:43 -0500)
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 <sage@redhat.com>
src/include/ceph_features.h
src/msg/async/AsyncConnection.cc
src/msg/simple/Pipe.cc

index f3841aeb0a2ddab4a2f1ea861f40d2e40018a5e2..55c60a1e207b36ee8017451a09130e01ad8e6aaa 100755 (executable)
@@ -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
index e489e79ab99f5b40aadf88162ab4a524a898b24c..c566dfe64c91792e42bce3613311cb2728c6afdf 100644 (file)
@@ -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;
       }
index fb8bed2fa292f5500fa035ebb1f0cd81bb91dcc1..1b531675d866bc7ed259e92df65e5cf1dc808b23 100644 (file)
@@ -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