]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: verify current release has a cephfs feature bit
authorPatrick Donnelly <pdonnell@redhat.com>
Mon, 1 Apr 2019 23:52:34 +0000 (16:52 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 3 Apr 2019 22:16:42 +0000 (15:16 -0700)
Fixes: http://tracker.ceph.com/issues/39077
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/Server.cc
src/mds/cephfs_features.h

index 2c5ff3f30afa55473ceefffcab2240747ce75140..beb5e1e52374114b8f991fd66ed6fcf9886b373b 100644 (file)
@@ -1362,6 +1362,9 @@ void Server::update_required_client_features()
 {
   vector<size_t> bits = CEPHFS_FEATURES_MDS_REQUIRED;
 
+  /* If this blows up on you, you added a release without adding a new release bit to cephfs_features.h */
+  static_assert(CEPHFS_CURRENT_RELEASE == CEPH_RELEASE_MAX-1);
+
   int min_compat = mds->mdsmap->get_min_compat_client();
   if (min_compat >= CEPH_RELEASE_NAUTILUS) {
     bits.push_back(CEPHFS_FEATURE_NAUTILUS);
index 66752af26270eedbe7a4ee07f7da1e0ab5261e71..e2a5a6cc3068d3989f9b8cb118f38274f272f6e3 100644 (file)
 #ifndef CEPHFS_FEATURES_H
 #define CEPHFS_FEATURES_H
 
-// Please add feature bits for later ceph releases and update
-// Server::update_required_client_features().
+// When adding a new release, please update the "current" release below, add a
+// feature bit for that release, add that feature bit to CEPHFS_FEATURES_ALL,
+// and update Server::update_required_client_features(). This feature bit
+// is used to indicate that operator only wants clients from that release or
+// later to mount CephFS.
+#define CEPHFS_CURRENT_RELEASE  CEPH_RELEASE_OCTOPUS
 
 // The first 5 bits are reserved for old ceph releases.
 #define CEPHFS_FEATURE_JEWEL           5