]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: do not allow setting a reserved feature by name
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 17 Dec 2020 16:59:46 +0000 (08:59 -0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 7 Jan 2021 17:08:55 +0000 (09:08 -0800)
Fixes: https://tracker.ceph.com/issues/48661
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/cephfs_features.cc

index 09c9c010399e973dac103c30b63f194990051513..7469e49081484554330e596f468ba39c207ec7c3 100644 (file)
@@ -35,6 +35,9 @@ std::string_view cephfs_feature_name(size_t id)
 
 int cephfs_feature_from_name(std::string_view name)
 {
+  if (name == "reserved"sv) {
+    return -1;
+  }
   for (size_t i = 0; i < feature_names.size(); ++i) {
     if (name == feature_names[i])
       return i;