mds: do not allow setting a reserved feature by name

Fixes: https://tracker.ceph.com/issues/48661
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
This commit is contained in:
Patrick Donnelly 2020-12-17 08:59:46 -08:00
parent 83e91b6cca
commit 15ba9dc944
No known key found for this signature in database
GPG Key ID: 3A2A7E25BEA8AADB

View 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;