1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2017 Red Hat Ltd
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
16 #include "OSDMonitor.h"
18 #include "FSCommands.h"
19 #include "MDSMonitor.h"
20 #include "MgrStatMonitor.h"
21 #include "mds/cephfs_features.h"
23 using TOPNSPC::common::cmd_getval
;
36 using ceph::bufferlist
;
39 using ceph::ErasureCodeInterfaceRef
;
40 using ceph::ErasureCodeProfile
;
41 using ceph::Formatter
;
42 using ceph::JSONFormatter
;
43 using ceph::make_message
;
44 using ceph::mono_clock
;
45 using ceph::mono_time
;
47 class FlagSetHandler
: public FileSystemCommandHandler
51 : FileSystemCommandHandler("fs flag set")
59 const cmdmap_t
& cmdmap
,
60 std::ostream
&ss
) override
63 cmd_getval(cmdmap
, "flag_name", flag_name
);
66 cmd_getval(cmdmap
, "val", flag_val
);
69 cmd_getval(cmdmap
, "yes_i_really_mean_it", sure
);
71 if (flag_name
== "enable_multiple") {
72 bool flag_bool
= false;
73 int r
= parse_bool(flag_val
, &flag_bool
, ss
);
75 ss
<< "Invalid boolean value '" << flag_val
<< "'";
79 fsmap
.set_enable_multiple(flag_bool
);
82 ss
<< "Unknown flag '" << flag_name
<< "'";
88 class FailHandler
: public FileSystemCommandHandler
92 : FileSystemCommandHandler("fs fail")
100 const cmdmap_t
& cmdmap
,
101 std::ostream
& ss
) override
103 if (!mon
->osdmon()->is_writeable()) {
104 // not allowed to write yet, so retry when we can
105 mon
->osdmon()->wait_for_writeable(op
, new PaxosService::C_RetryMessage(mon
->mdsmon(), op
));
110 if (!cmd_getval(cmdmap
, "fs_name", fs_name
) || fs_name
.empty()) {
111 ss
<< "Missing filesystem name";
115 auto fs
= fsmap
.get_filesystem(fs_name
);
117 auto f
= [](auto fs
) {
118 fs
->mds_map
.set_flag(CEPH_MDSMAP_NOT_JOINABLE
);
120 fsmap
.modify_filesystem(fs
->fscid
, std::move(f
));
122 std::vector
<mds_gid_t
> to_fail
;
123 for (const auto& p
: fs
->mds_map
.get_mds_info()) {
124 to_fail
.push_back(p
.first
);
127 for (const auto& gid
: to_fail
) {
128 mon
->mdsmon()->fail_mds_gid(fsmap
, gid
);
130 if (!to_fail
.empty()) {
131 mon
->osdmon()->propose_pending();
135 ss
<< " marked not joinable; MDS cannot join the cluster. All MDS ranks marked failed.";
141 class FsNewHandler
: public FileSystemCommandHandler
144 explicit FsNewHandler(Paxos
*paxos
)
145 : FileSystemCommandHandler("fs new"), m_paxos(paxos
)
149 bool batched_propose() override
{
157 const cmdmap_t
& cmdmap
,
158 std::ostream
&ss
) override
160 ceph_assert(m_paxos
->is_plugged());
162 string metadata_name
;
163 cmd_getval(cmdmap
, "metadata", metadata_name
);
164 int64_t metadata
= mon
->osdmon()->osdmap
.lookup_pg_pool_name(metadata_name
);
166 ss
<< "pool '" << metadata_name
<< "' does not exist";
171 cmd_getval(cmdmap
, "data", data_name
);
172 int64_t data
= mon
->osdmon()->osdmap
.lookup_pg_pool_name(data_name
);
174 ss
<< "pool '" << data_name
<< "' does not exist";
178 ss
<< "pool '" << data_name
<< "' has id 0, which CephFS does not allow. Use another pool or recreate it to get a non-zero pool id.";
183 cmd_getval(cmdmap
, "fs_name", fs_name
);
184 if (fs_name
.empty()) {
185 // Ensure fs name is not empty so that we can implement
186 // commmands that refer to FS by name in future.
187 ss
<< "Filesystem name may not be empty";
191 if (fsmap
.get_filesystem(fs_name
)) {
192 auto fs
= fsmap
.get_filesystem(fs_name
);
193 if (*(fs
->mds_map
.get_data_pools().begin()) == data
194 && fs
->mds_map
.get_metadata_pool() == metadata
) {
195 // Identical FS created already, this is a no-op
196 ss
<< "filesystem '" << fs_name
<< "' already exists";
199 ss
<< "filesystem already exists with name '" << fs_name
<< "'";
205 cmd_getval(cmdmap
, "force", force
);
207 const pool_stat_t
*stat
= mon
->mgrstatmon()->get_pool_stat(metadata
);
209 int64_t metadata_num_objects
= stat
->stats
.sum
.num_objects
;
210 if (!force
&& metadata_num_objects
> 0) {
211 ss
<< "pool '" << metadata_name
212 << "' already contains some objects. Use an empty pool instead.";
217 if (fsmap
.filesystem_count() > 0
218 && !fsmap
.get_enable_multiple()) {
219 ss
<< "Creation of multiple filesystems is disabled. To enable "
220 "this experimental feature, use 'ceph fs flag set enable_multiple "
225 bool allow_overlay
= false;
226 cmd_getval(cmdmap
, "allow_dangerous_metadata_overlay", allow_overlay
);
228 for (auto& fs
: fsmap
.get_filesystems()) {
229 const std::vector
<int64_t> &data_pools
= fs
->mds_map
.get_data_pools();
230 if ((std::find(data_pools
.begin(), data_pools
.end(), data
) != data_pools
.end()
231 || fs
->mds_map
.get_metadata_pool() == metadata
)
233 ss
<< "Filesystem '" << fs_name
234 << "' is already using one of the specified RADOS pools. This should ONLY be done in emergencies and after careful reading of the documentation. Pass --allow-dangerous-metadata-overlay to permit this.";
239 int64_t fscid
= FS_CLUSTER_ID_NONE
;
240 if (cmd_getval(cmdmap
, "fscid", fscid
)) {
242 ss
<< "Pass --force to create a file system with a specific ID";
245 if (fsmap
.filesystem_exists(fscid
)) {
246 ss
<< "filesystem already exists with id '" << fscid
<< "'";
251 pg_pool_t
const *data_pool
= mon
->osdmon()->osdmap
.get_pg_pool(data
);
252 ceph_assert(data_pool
!= NULL
); // Checked it existed above
253 pg_pool_t
const *metadata_pool
= mon
->osdmon()->osdmap
.get_pg_pool(metadata
);
254 ceph_assert(metadata_pool
!= NULL
); // Checked it existed above
256 int r
= _check_pool(mon
->osdmon()->osdmap
, data
, POOL_DATA_DEFAULT
, force
, &ss
, allow_overlay
);
261 r
= _check_pool(mon
->osdmon()->osdmap
, metadata
, POOL_METADATA
, force
, &ss
, allow_overlay
);
266 if (!mon
->osdmon()->is_writeable()) {
267 // not allowed to write yet, so retry when we can
268 mon
->osdmon()->wait_for_writeable(op
, new PaxosService::C_RetryMessage(mon
->mdsmon(), op
));
271 mon
->osdmon()->do_application_enable(data
,
272 pg_pool_t::APPLICATION_NAME_CEPHFS
,
273 "data", fs_name
, true);
274 mon
->osdmon()->do_application_enable(metadata
,
275 pg_pool_t::APPLICATION_NAME_CEPHFS
,
276 "metadata", fs_name
, true);
277 mon
->osdmon()->do_set_pool_opt(metadata
,
278 pool_opts_t::RECOVERY_PRIORITY
,
279 static_cast<int64_t>(5));
280 mon
->osdmon()->do_set_pool_opt(metadata
,
281 pool_opts_t::PG_NUM_MIN
,
282 static_cast<int64_t>(16));
283 mon
->osdmon()->do_set_pool_opt(metadata
,
284 pool_opts_t::PG_AUTOSCALE_BIAS
,
285 static_cast<double>(4.0));
286 mon
->osdmon()->propose_pending();
288 bool recover
= false;
289 cmd_getval(cmdmap
, "recover", recover
);
291 // All checks passed, go ahead and create.
292 auto&& fs
= fsmap
.create_filesystem(fs_name
, metadata
, data
,
293 mon
->get_quorum_con_features(), fscid
, recover
);
295 ss
<< "new fs with metadata pool " << metadata
<< " and data pool " << data
;
301 // assign a standby to rank 0 to avoid health warnings
302 auto info
= fsmap
.find_replacement_for({fs
->fscid
, 0});
305 mon
->clog
->info() << info
->human_name() << " assigned to filesystem "
306 << fs_name
<< " as rank 0";
307 fsmap
.promote(info
->global_id
, *fs
, 0);
317 class SetHandler
: public FileSystemCommandHandler
321 : FileSystemCommandHandler("fs set")
328 const cmdmap_t
& cmdmap
,
329 std::ostream
&ss
) override
332 if (!cmd_getval(cmdmap
, "fs_name", fs_name
) || fs_name
.empty()) {
333 ss
<< "Missing filesystem name";
337 auto fs
= fsmap
.get_filesystem(fs_name
);
339 if (!cmd_getval(cmdmap
, "var", var
) || var
.empty()) {
340 ss
<< "Invalid variable";
346 if (!cmd_getval(cmdmap
, "val", val
)) {
349 // we got a string. see if it contains an int.
350 n
= strict_strtoll(val
.c_str(), 10, &interr
);
351 if (var
== "max_mds") {
352 // NOTE: see also "mds set_max_mds", which can modify the same field.
353 if (interr
.length()) {
359 ss
<< "You must specify at least one MDS";
363 if (n
> 1 && n
> fs
->mds_map
.get_max_mds()) {
364 if (fs
->mds_map
.was_snaps_ever_allowed() &&
365 !fs
->mds_map
.allows_multimds_snaps()) {
366 ss
<< "multi-active MDS is not allowed while there are snapshots possibly created by pre-mimic MDS";
371 ss
<< "may not have more than " << MAX_MDS
<< " MDS ranks";
375 fsmap
.modify_filesystem(
377 [n
](std::shared_ptr
<Filesystem
> fs
)
379 fs
->mds_map
.clear_flag(CEPH_MDSMAP_NOT_JOINABLE
);
380 fs
->mds_map
.set_max_mds(n
);
382 } else if (var
== "inline_data") {
383 bool enable_inline
= false;
384 int r
= parse_bool(val
, &enable_inline
, ss
);
390 bool confirm
= false;
391 cmd_getval(cmdmap
, "yes_i_really_really_mean_it", confirm
);
393 ss
<< "Inline data support is deprecated and will be removed in a future release. "
394 << "Add --yes-i-really-really-mean-it if you are certain you want this enabled.";
397 ss
<< "inline data enabled";
399 fsmap
.modify_filesystem(
401 [](std::shared_ptr
<Filesystem
> fs
)
403 fs
->mds_map
.set_inline_data_enabled(true);
406 ss
<< "inline data disabled";
407 fsmap
.modify_filesystem(
409 [](std::shared_ptr
<Filesystem
> fs
)
411 fs
->mds_map
.set_inline_data_enabled(false);
414 } else if (var
== "balancer") {
416 ss
<< "unsetting the metadata load balancer";
418 ss
<< "setting the metadata load balancer to " << val
;
420 fsmap
.modify_filesystem(
422 [val
](std::shared_ptr
<Filesystem
> fs
)
424 fs
->mds_map
.set_balancer(val
);
427 } else if (var
== "bal_rank_mask") {
429 ss
<< "bal_rank_mask may not be empty";
433 if (fs
->mds_map
.check_special_bal_rank_mask(val
, MDSMap::BAL_RANK_MASK_TYPE_ANY
) == false) {
434 std::string bin_string
;
435 int r
= fs
->mds_map
.hex2bin(val
, bin_string
, MAX_MDS
, ss
);
440 ss
<< "setting the metadata balancer rank mask to " << val
;
442 fsmap
.modify_filesystem(
444 [val
](std::shared_ptr
<Filesystem
> fs
)
446 fs
->mds_map
.set_bal_rank_mask(val
);
449 } else if (var
== "max_file_size") {
450 if (interr
.length()) {
451 ss
<< var
<< " requires an integer value";
454 if (n
< CEPH_MIN_STRIPE_UNIT
) {
455 ss
<< var
<< " must at least " << CEPH_MIN_STRIPE_UNIT
;
458 fsmap
.modify_filesystem(
460 [n
](std::shared_ptr
<Filesystem
> fs
)
462 fs
->mds_map
.set_max_filesize(n
);
464 } else if (var
== "allow_new_snaps") {
465 bool enable_snaps
= false;
466 int r
= parse_bool(val
, &enable_snaps
, ss
);
472 fsmap
.modify_filesystem(
474 [](std::shared_ptr
<Filesystem
> fs
)
476 fs
->mds_map
.clear_snaps_allowed();
478 ss
<< "disabled new snapshots";
480 fsmap
.modify_filesystem(
482 [](std::shared_ptr
<Filesystem
> fs
)
484 fs
->mds_map
.set_snaps_allowed();
486 ss
<< "enabled new snapshots";
488 } else if (var
== "allow_multimds") {
489 ss
<< "Multiple MDS is always enabled. Use the max_mds"
490 << " parameter to control the number of active MDSs"
491 << " allowed. This command is DEPRECATED and will be"
492 << " REMOVED from future releases.";
493 } else if (var
== "allow_multimds_snaps") {
495 int r
= parse_bool(val
, &enable
, ss
);
501 if (!cmd_getval(cmdmap
, "confirm", confirm
) ||
502 confirm
!= "--yes-i-am-really-a-mds") {
503 ss
<< "Warning! This command is for MDS only. Do not run it manually";
508 ss
<< "enabled multimds with snapshot";
509 fsmap
.modify_filesystem(
511 [](std::shared_ptr
<Filesystem
> fs
)
513 fs
->mds_map
.set_multimds_snaps_allowed();
516 ss
<< "disabled multimds with snapshot";
517 fsmap
.modify_filesystem(
519 [](std::shared_ptr
<Filesystem
> fs
)
521 fs
->mds_map
.clear_multimds_snaps_allowed();
524 } else if (var
== "allow_dirfrags") {
525 ss
<< "Directory fragmentation is now permanently enabled."
526 << " This command is DEPRECATED and will be REMOVED from future releases.";
527 } else if (var
== "down") {
528 bool is_down
= false;
529 int r
= parse_bool(val
, &is_down
, ss
);
534 ss
<< fs
->mds_map
.get_fs_name();
536 fsmap
.modify_filesystem(
538 [is_down
](std::shared_ptr
<Filesystem
> fs
)
541 if (fs
->mds_map
.get_max_mds() > 0) {
542 fs
->mds_map
.set_old_max_mds();
543 fs
->mds_map
.set_max_mds(0);
544 } /* else already down! */
546 mds_rank_t oldmax
= fs
->mds_map
.get_old_max_mds();
547 fs
->mds_map
.set_max_mds(oldmax
? oldmax
: 1);
552 ss
<< " marked down. ";
554 ss
<< " marked up, max_mds = " << fs
->mds_map
.get_max_mds();
556 } else if (var
== "cluster_down" || var
== "joinable") {
557 bool joinable
= true;
558 int r
= parse_bool(val
, &joinable
, ss
);
562 if (var
== "cluster_down") {
563 joinable
= !joinable
;
566 ss
<< fs
->mds_map
.get_fs_name();
568 fsmap
.modify_filesystem(
570 [joinable
](std::shared_ptr
<Filesystem
> fs
)
573 fs
->mds_map
.clear_flag(CEPH_MDSMAP_NOT_JOINABLE
);
575 fs
->mds_map
.set_flag(CEPH_MDSMAP_NOT_JOINABLE
);
580 ss
<< " marked joinable; MDS may join as newly active.";
582 ss
<< " marked not joinable; MDS cannot join as newly active.";
585 if (var
== "cluster_down") {
586 ss
<< " WARNING: cluster_down flag is deprecated and will be"
587 << " removed in a future version. Please use \"joinable\".";
589 } else if (var
== "standby_count_wanted") {
590 if (interr
.length()) {
591 ss
<< var
<< " requires an integer value";
595 ss
<< var
<< " must be non-negative";
598 fsmap
.modify_filesystem(
600 [n
](std::shared_ptr
<Filesystem
> fs
)
602 fs
->mds_map
.set_standby_count_wanted(n
);
604 } else if (var
== "session_timeout") {
605 if (interr
.length()) {
606 ss
<< var
<< " requires an integer value";
610 ss
<< var
<< " must be at least 30s";
613 fsmap
.modify_filesystem(
615 [n
](std::shared_ptr
<Filesystem
> fs
)
617 fs
->mds_map
.set_session_timeout((uint32_t)n
);
619 } else if (var
== "session_autoclose") {
620 if (interr
.length()) {
621 ss
<< var
<< " requires an integer value";
625 ss
<< var
<< " must be at least 30s";
628 fsmap
.modify_filesystem(
630 [n
](std::shared_ptr
<Filesystem
> fs
)
632 fs
->mds_map
.set_session_autoclose((uint32_t)n
);
634 } else if (var
== "allow_standby_replay") {
636 int r
= parse_bool(val
, &allow
, ss
);
642 if (!mon
->osdmon()->is_writeable()) {
643 // not allowed to write yet, so retry when we can
644 mon
->osdmon()->wait_for_writeable(op
, new PaxosService::C_RetryMessage(mon
->mdsmon(), op
));
647 std::vector
<mds_gid_t
> to_fail
;
648 for (const auto& [gid
, info
]: fs
->mds_map
.get_mds_info()) {
649 if (info
.state
== MDSMap::STATE_STANDBY_REPLAY
) {
650 to_fail
.push_back(gid
);
654 for (const auto& gid
: to_fail
) {
655 mon
->mdsmon()->fail_mds_gid(fsmap
, gid
);
657 if (!to_fail
.empty()) {
658 mon
->osdmon()->propose_pending();
662 auto f
= [allow
](auto& fs
) {
664 fs
->mds_map
.set_standby_replay_allowed();
666 fs
->mds_map
.clear_standby_replay_allowed();
669 fsmap
.modify_filesystem(fs
->fscid
, std::move(f
));
670 } else if (var
== "min_compat_client") {
671 auto vno
= ceph_release_from_name(val
.c_str());
673 ss
<< "version " << val
<< " is not recognized";
676 ss
<< "WARNING: setting min_compat_client is deprecated"
677 " and may not do what you want.\n"
678 "The oldest release to set is octopus.\n"
679 "Please migrate to `ceph fs required_client_features ...`.";
680 auto f
= [vno
](auto&& fs
) {
681 fs
->mds_map
.set_min_compat_client(vno
);
683 fsmap
.modify_filesystem(fs
->fscid
, std::move(f
));
684 } else if (var
== "refuse_client_session") {
685 bool refuse_session
= false;
686 int r
= parse_bool(val
, &refuse_session
, ss
);
691 if (refuse_session
) {
692 if (!(fs
->mds_map
.test_flag(CEPH_MDSMAP_REFUSE_CLIENT_SESSION
))) {
693 fsmap
.modify_filesystem(
695 [](std::shared_ptr
<Filesystem
> fs
)
697 fs
->mds_map
.set_flag(CEPH_MDSMAP_REFUSE_CLIENT_SESSION
);
699 ss
<< "client(s) blocked from establishing new session(s)";
701 ss
<< "client(s) already blocked from establishing new session(s)";
704 if (fs
->mds_map
.test_flag(CEPH_MDSMAP_REFUSE_CLIENT_SESSION
)) {
705 fsmap
.modify_filesystem(
707 [](std::shared_ptr
<Filesystem
> fs
)
709 fs
->mds_map
.clear_flag(CEPH_MDSMAP_REFUSE_CLIENT_SESSION
);
711 ss
<< "client(s) allowed to establish new session(s)";
713 ss
<< "client(s) already allowed to establish new session(s)";
717 ss
<< "unknown variable " << var
;
725 class CompatSetHandler
: public FileSystemCommandHandler
729 : FileSystemCommandHandler("fs compat")
737 const cmdmap_t
& cmdmap
,
738 std::ostream
&ss
) override
740 static const std::set
<std::string
> subops
= {"rm_incompat", "rm_compat", "add_incompat", "add_compat"};
743 if (!cmd_getval(cmdmap
, "fs_name", fs_name
) || fs_name
.empty()) {
744 ss
<< "Missing filesystem name";
747 auto fs
= fsmap
.get_filesystem(fs_name
);
749 ss
<< "Not found: '" << fs_name
<< "'";
754 if (!cmd_getval(cmdmap
, "subop", subop
) || subops
.count(subop
) == 0) {
755 ss
<< "subop `" << subop
<< "' not recognized. Must be one of: " << subops
;
760 if (!cmd_getval(cmdmap
, "feature", feature
) || feature
<= 0) {
761 ss
<< "Invalid feature";
765 if (fs
->mds_map
.get_num_up_mds() > 0) {
766 ss
<< "file system must be failed or down; use `ceph fs fail` to bring down";
770 CompatSet cs
= fs
->mds_map
.compat
;
771 if (subop
== "rm_compat") {
772 if (cs
.compat
.contains(feature
)) {
773 ss
<< "removed compat feature " << feature
;
774 cs
.compat
.remove(feature
);
776 ss
<< "already removed compat feature " << feature
;
778 } else if (subop
== "rm_incompat") {
779 if (cs
.incompat
.contains(feature
)) {
780 ss
<< "removed incompat feature " << feature
;
781 cs
.incompat
.remove(feature
);
783 ss
<< "already removed incompat feature " << feature
;
785 } else if (subop
== "add_compat" || subop
== "add_incompat") {
787 if (!cmd_getval(cmdmap
, "feature_str", feature_str
) || feature_str
.empty()) {
788 ss
<< "adding a feature requires a feature string";
791 auto f
= CompatSet::Feature(feature
, feature_str
);
792 if (subop
== "add_compat") {
793 if (cs
.compat
.contains(feature
)) {
794 auto name
= cs
.compat
.get_name(feature
);
795 if (name
== feature_str
) {
796 ss
<< "feature already exists";
798 ss
<< "feature with differing name `" << name
<< "' exists";
803 ss
<< "added compat feature " << f
;
805 } else if (subop
== "add_incompat") {
806 if (cs
.incompat
.contains(feature
)) {
807 auto name
= cs
.incompat
.get_name(feature
);
808 if (name
== feature_str
) {
809 ss
<< "feature already exists";
811 ss
<< "feature with differing name `" << name
<< "' exists";
815 cs
.incompat
.insert(f
);
816 ss
<< "added incompat feature " << f
;
818 } else ceph_assert(0);
819 } else ceph_assert(0);
821 auto modifyf
= [cs
= std::move(cs
)](auto&& fs
) {
822 fs
->mds_map
.compat
= cs
;
825 fsmap
.modify_filesystem(fs
->fscid
, std::move(modifyf
));
830 class RequiredClientFeaturesHandler
: public FileSystemCommandHandler
833 RequiredClientFeaturesHandler()
834 : FileSystemCommandHandler("fs required_client_features")
842 const cmdmap_t
& cmdmap
,
843 std::ostream
&ss
) override
846 if (!cmd_getval(cmdmap
, "fs_name", fs_name
) || fs_name
.empty()) {
847 ss
<< "Missing filesystem name";
850 auto fs
= fsmap
.get_filesystem(fs_name
);
852 ss
<< "Not found: '" << fs_name
<< "'";
856 if (!cmd_getval(cmdmap
, "subop", subop
) ||
857 (subop
!= "add" && subop
!= "rm")) {
858 ss
<< "Must either add or rm a feature; " << subop
<< " is not recognized";
862 if (!cmd_getval(cmdmap
, "val", val
) || val
.empty()) {
863 ss
<< "Missing feature id/name";
867 int feature
= cephfs_feature_from_name(val
);
870 feature
= strict_strtol(val
.c_str(), 10, &err
);
872 ss
<< "Invalid feature name: " << val
;
875 if (feature
< 0 || feature
> CEPHFS_FEATURE_MAX
) {
876 ss
<< "Invalid feature id: " << feature
;
881 if (subop
== "add") {
883 fsmap
.modify_filesystem(
885 [feature
, &ret
](auto&& fs
)
887 if (fs
->mds_map
.get_required_client_features().test(feature
))
889 fs
->mds_map
.add_required_client_feature(feature
);
893 ss
<< "added feature '" << cephfs_feature_name(feature
) << "' to required_client_features";
895 ss
<< "feature '" << cephfs_feature_name(feature
) << "' is already set";
899 fsmap
.modify_filesystem(
901 [feature
, &ret
](auto&& fs
)
903 if (!fs
->mds_map
.get_required_client_features().test(feature
))
905 fs
->mds_map
.remove_required_client_feature(feature
);
909 ss
<< "removed feature '" << cephfs_feature_name(feature
) << "' from required_client_features";
911 ss
<< "feature '" << cephfs_feature_name(feature
) << "' is already unset";
919 class AddDataPoolHandler
: public FileSystemCommandHandler
922 explicit AddDataPoolHandler(Paxos
*paxos
)
923 : FileSystemCommandHandler("fs add_data_pool"), m_paxos(paxos
)
926 bool batched_propose() override
{
934 const cmdmap_t
& cmdmap
,
935 std::ostream
&ss
) override
937 ceph_assert(m_paxos
->is_plugged());
940 cmd_getval(cmdmap
, "pool", poolname
);
943 if (!cmd_getval(cmdmap
, "fs_name", fs_name
)
944 || fs_name
.empty()) {
945 ss
<< "Missing filesystem name";
949 int64_t poolid
= mon
->osdmon()->osdmap
.lookup_pg_pool_name(poolname
);
952 poolid
= strict_strtol(poolname
.c_str(), 10, &err
);
954 ss
<< "pool '" << poolname
<< "' does not exist";
959 int r
= _check_pool(mon
->osdmon()->osdmap
, poolid
, POOL_DATA_EXTRA
, false, &ss
);
964 auto fs
= fsmap
.get_filesystem(fs_name
);
965 // no-op when the data_pool already on fs
966 if (fs
->mds_map
.is_data_pool(poolid
)) {
967 ss
<< "data pool " << poolid
<< " is already on fs " << fs_name
;
971 if (!mon
->osdmon()->is_writeable()) {
972 // not allowed to write yet, so retry when we can
973 mon
->osdmon()->wait_for_writeable(op
, new PaxosService::C_RetryMessage(mon
->mdsmon(), op
));
976 mon
->osdmon()->do_application_enable(poolid
,
977 pg_pool_t::APPLICATION_NAME_CEPHFS
,
978 "data", fs_name
, true);
979 mon
->osdmon()->propose_pending();
981 fsmap
.modify_filesystem(
983 [poolid
](std::shared_ptr
<Filesystem
> fs
)
985 fs
->mds_map
.add_data_pool(poolid
);
988 ss
<< "added data pool " << poolid
<< " to fsmap";
997 class SetDefaultHandler
: public FileSystemCommandHandler
1001 : FileSystemCommandHandler("fs set-default")
1008 const cmdmap_t
& cmdmap
,
1009 std::ostream
&ss
) override
1011 std::string fs_name
;
1012 cmd_getval(cmdmap
, "fs_name", fs_name
);
1013 auto fs
= fsmap
.get_filesystem(fs_name
);
1014 if (fs
== nullptr) {
1015 ss
<< "filesystem '" << fs_name
<< "' does not exist";
1019 fsmap
.set_legacy_client_fscid(fs
->fscid
);
1024 class RemoveFilesystemHandler
: public FileSystemCommandHandler
1027 RemoveFilesystemHandler()
1028 : FileSystemCommandHandler("fs rm")
1035 const cmdmap_t
& cmdmap
,
1036 std::ostream
&ss
) override
1038 /* We may need to blocklist ranks. */
1039 if (!mon
->osdmon()->is_writeable()) {
1040 // not allowed to write yet, so retry when we can
1041 mon
->osdmon()->wait_for_writeable(op
, new PaxosService::C_RetryMessage(mon
->mdsmon(), op
));
1045 // Check caller has correctly named the FS to delete
1046 // (redundant while there is only one FS, but command
1047 // syntax should apply to multi-FS future)
1049 cmd_getval(cmdmap
, "fs_name", fs_name
);
1050 auto fs
= fsmap
.get_filesystem(fs_name
);
1051 if (fs
== nullptr) {
1052 // Consider absence success to make deletes idempotent
1053 ss
<< "filesystem '" << fs_name
<< "' does not exist";
1057 // Check that no MDS daemons are active
1058 if (fs
->mds_map
.get_num_up_mds() > 0) {
1059 ss
<< "all MDS daemons must be inactive/failed before removing filesystem. See `ceph fs fail`.";
1063 // Check for confirmation flag
1065 cmd_getval(cmdmap
, "yes_i_really_mean_it", sure
);
1067 ss
<< "this is a DESTRUCTIVE operation and will make data in your filesystem permanently" \
1068 " inaccessible. Add --yes-i-really-mean-it if you are sure you wish to continue.";
1072 if (fsmap
.get_legacy_client_fscid() == fs
->fscid
) {
1073 fsmap
.set_legacy_client_fscid(FS_CLUSTER_ID_NONE
);
1076 std::vector
<mds_gid_t
> to_fail
;
1077 // There may be standby_replay daemons left here
1078 for (const auto &i
: fs
->mds_map
.get_mds_info()) {
1079 ceph_assert(i
.second
.state
== MDSMap::STATE_STANDBY_REPLAY
);
1080 to_fail
.push_back(i
.first
);
1083 for (const auto &gid
: to_fail
) {
1084 // Standby replays don't write, so it isn't important to
1085 // wait for an osdmap propose here: ignore return value.
1086 mon
->mdsmon()->fail_mds_gid(fsmap
, gid
);
1088 if (!to_fail
.empty()) {
1089 mon
->osdmon()->propose_pending(); /* maybe new blocklists */
1092 fsmap
.erase_filesystem(fs
->fscid
);
1098 class ResetFilesystemHandler
: public FileSystemCommandHandler
1101 ResetFilesystemHandler()
1102 : FileSystemCommandHandler("fs reset")
1109 const cmdmap_t
& cmdmap
,
1110 std::ostream
&ss
) override
1113 cmd_getval(cmdmap
, "fs_name", fs_name
);
1114 auto fs
= fsmap
.get_filesystem(fs_name
);
1115 if (fs
== nullptr) {
1116 ss
<< "filesystem '" << fs_name
<< "' does not exist";
1117 // Unlike fs rm, we consider this case an error
1121 // Check that no MDS daemons are active
1122 if (fs
->mds_map
.get_num_up_mds() > 0) {
1123 ss
<< "all MDS daemons must be inactive before resetting filesystem: set the cluster_down flag"
1124 " and use `ceph mds fail` to make this so";
1128 // Check for confirmation flag
1130 cmd_getval(cmdmap
, "yes_i_really_mean_it", sure
);
1132 ss
<< "this is a potentially destructive operation, only for use by experts in disaster recovery. "
1133 "Add --yes-i-really-mean-it if you are sure you wish to continue.";
1137 fsmap
.reset_filesystem(fs
->fscid
);
1143 class RenameFilesystemHandler
: public FileSystemCommandHandler
1146 explicit RenameFilesystemHandler(Paxos
*paxos
)
1147 : FileSystemCommandHandler("fs rename"), m_paxos(paxos
)
1151 bool batched_propose() override
{
1159 const cmdmap_t
& cmdmap
,
1160 std::ostream
&ss
) override
1162 ceph_assert(m_paxos
->is_plugged());
1165 cmd_getval(cmdmap
, "fs_name", fs_name
);
1166 auto fs
= fsmap
.get_filesystem(fs_name
);
1169 cmd_getval(cmdmap
, "new_fs_name", new_fs_name
);
1170 auto new_fs
= fsmap
.get_filesystem(new_fs_name
);
1172 if (fs
== nullptr) {
1174 // make 'fs rename' idempotent
1175 ss
<< "File system may already have been renamed. Desired file system '"
1176 << new_fs_name
<< "' exists.";
1179 ss
<< "File system '" << fs_name
<< "' does not exist";
1185 ss
<< "Desired file system name '" << new_fs_name
<< "' already in use";
1189 if (fs
->mirror_info
.mirrored
) {
1190 ss
<< "Mirroring is enabled on file system '"<< fs_name
<< "'. Disable mirroring on the "
1191 "file system after ensuring it's OK to do so, and then retry to rename.";
1195 // Check for confirmation flag
1197 cmd_getval(cmdmap
, "yes_i_really_mean_it", sure
);
1199 ss
<< "this is a potentially disruptive operation, clients' cephx credentials need reauthorized "
1200 "to access the file system and its pools with the new name. "
1201 "Add --yes-i-really-mean-it if you are sure you wish to continue.";
1205 if (!mon
->osdmon()->is_writeable()) {
1206 // not allowed to write yet, so retry when we can
1207 mon
->osdmon()->wait_for_writeable(op
, new PaxosService::C_RetryMessage(mon
->mdsmon(), op
));
1210 for (const auto p
: fs
->mds_map
.get_data_pools()) {
1211 mon
->osdmon()->do_application_enable(p
,
1212 pg_pool_t::APPLICATION_NAME_CEPHFS
,
1213 "data", new_fs_name
, true);
1216 mon
->osdmon()->do_application_enable(fs
->mds_map
.get_metadata_pool(),
1217 pg_pool_t::APPLICATION_NAME_CEPHFS
,
1218 "metadata", new_fs_name
, true);
1219 mon
->osdmon()->propose_pending();
1221 auto f
= [new_fs_name
](auto fs
) {
1222 fs
->mds_map
.set_fs_name(new_fs_name
);
1224 fsmap
.modify_filesystem(fs
->fscid
, std::move(f
));
1226 ss
<< "File system is renamed. cephx credentials authorized to "
1227 "old file system name need to be reauthorized to new file "
1237 class RemoveDataPoolHandler
: public FileSystemCommandHandler
1240 RemoveDataPoolHandler()
1241 : FileSystemCommandHandler("fs rm_data_pool")
1248 const cmdmap_t
& cmdmap
,
1249 std::ostream
&ss
) override
1252 cmd_getval(cmdmap
, "pool", poolname
);
1254 std::string fs_name
;
1255 if (!cmd_getval(cmdmap
, "fs_name", fs_name
)
1256 || fs_name
.empty()) {
1257 ss
<< "Missing filesystem name";
1261 int64_t poolid
= mon
->osdmon()->osdmap
.lookup_pg_pool_name(poolname
);
1264 poolid
= strict_strtol(poolname
.c_str(), 10, &err
);
1266 ss
<< "pool '" << poolname
<< "' does not exist";
1268 } else if (poolid
< 0) {
1269 ss
<< "invalid pool id '" << poolid
<< "'";
1274 ceph_assert(poolid
>= 0); // Checked by parsing code above
1276 auto fs
= fsmap
.get_filesystem(fs_name
);
1277 if (fs
->mds_map
.get_first_data_pool() == poolid
) {
1278 ss
<< "cannot remove default data pool";
1283 fsmap
.modify_filesystem(fs
->fscid
,
1284 [&r
, poolid
](std::shared_ptr
<Filesystem
> fs
)
1286 r
= fs
->mds_map
.remove_data_pool(poolid
);
1289 // It was already removed, succeed in silence
1291 } else if (r
== 0) {
1292 // We removed it, succeed
1293 ss
<< "removed data pool " << poolid
<< " from fsmap";
1296 // Unexpected error, bubble up
1303 * For commands with an alternative prefix
1305 template<typename T
>
1306 class AliasHandler
: public T
1308 std::string alias_prefix
;
1311 explicit AliasHandler(const std::string
&new_prefix
)
1314 alias_prefix
= new_prefix
;
1317 std::string
const &get_prefix() const override
{return alias_prefix
;}
1323 const cmdmap_t
& cmdmap
,
1324 std::ostream
&ss
) override
1326 return T::handle(mon
, fsmap
, op
, cmdmap
, ss
);
1330 class MirrorHandlerEnable
: public FileSystemCommandHandler
1333 MirrorHandlerEnable()
1334 : FileSystemCommandHandler("fs mirror enable")
1337 int handle(Monitor
*mon
,
1338 FSMap
&fsmap
, MonOpRequestRef op
,
1339 const cmdmap_t
& cmdmap
, std::ostream
&ss
) override
{
1340 std::string fs_name
;
1341 if (!cmd_getval(cmdmap
, "fs_name", fs_name
) || fs_name
.empty()) {
1342 ss
<< "Missing filesystem name";
1346 auto fs
= fsmap
.get_filesystem(fs_name
);
1347 if (fs
== nullptr) {
1348 ss
<< "Filesystem '" << fs_name
<< "' not found";
1352 if (fs
->mirror_info
.is_mirrored()) {
1356 auto f
= [](auto &&fs
) {
1357 fs
->mirror_info
.enable_mirroring();
1359 fsmap
.modify_filesystem(fs
->fscid
, std::move(f
));
1365 class MirrorHandlerDisable
: public FileSystemCommandHandler
1368 MirrorHandlerDisable()
1369 : FileSystemCommandHandler("fs mirror disable")
1372 int handle(Monitor
*mon
,
1373 FSMap
&fsmap
, MonOpRequestRef op
,
1374 const cmdmap_t
& cmdmap
, std::ostream
&ss
) override
{
1375 std::string fs_name
;
1376 if (!cmd_getval(cmdmap
, "fs_name", fs_name
) || fs_name
.empty()) {
1377 ss
<< "Missing filesystem name";
1381 auto fs
= fsmap
.get_filesystem(fs_name
);
1382 if (fs
== nullptr) {
1383 ss
<< "Filesystem '" << fs_name
<< "' not found";
1387 if (!fs
->mirror_info
.is_mirrored()) {
1391 auto f
= [](auto &&fs
) {
1392 fs
->mirror_info
.disable_mirroring();
1394 fsmap
.modify_filesystem(fs
->fscid
, std::move(f
));
1400 class MirrorHandlerAddPeer
: public FileSystemCommandHandler
1403 MirrorHandlerAddPeer()
1404 : FileSystemCommandHandler("fs mirror peer_add")
1407 boost::optional
<std::pair
<string
, string
>>
1408 extract_remote_cluster_conf(const std::string
&spec
) {
1409 auto pos
= spec
.find("@");
1410 if (pos
== std::string_view::npos
) {
1411 return boost::optional
<std::pair
<string
, string
>>();
1414 auto client
= spec
.substr(0, pos
);
1415 auto cluster
= spec
.substr(pos
+1);
1417 return std::make_pair(client
, cluster
);
1420 bool peer_add(FSMap
&fsmap
, Filesystem::const_ref
&&fs
,
1421 const cmdmap_t
&cmdmap
, std::ostream
&ss
) {
1424 string remote_fs_name
;
1425 cmd_getval(cmdmap
, "uuid", peer_uuid
);
1426 cmd_getval(cmdmap
, "remote_cluster_spec", remote_spec
);
1427 cmd_getval(cmdmap
, "remote_fs_name", remote_fs_name
);
1429 // verify (and extract) remote cluster specification
1430 auto remote_conf
= extract_remote_cluster_conf(remote_spec
);
1432 ss
<< "invalid remote cluster spec -- should be <client>@<cluster>";
1436 if (fs
->mirror_info
.has_peer(peer_uuid
)) {
1437 ss
<< "peer already exists";
1440 if (fs
->mirror_info
.has_peer((*remote_conf
).first
, (*remote_conf
).second
,
1442 ss
<< "peer already exists";
1446 auto f
= [peer_uuid
, remote_conf
, remote_fs_name
](auto &&fs
) {
1447 fs
->mirror_info
.peer_add(peer_uuid
, (*remote_conf
).first
,
1448 (*remote_conf
).second
, remote_fs_name
);
1450 fsmap
.modify_filesystem(fs
->fscid
, std::move(f
));
1454 int handle(Monitor
*mon
,
1455 FSMap
&fsmap
, MonOpRequestRef op
,
1456 const cmdmap_t
& cmdmap
, std::ostream
&ss
) override
{
1457 std::string fs_name
;
1458 if (!cmd_getval(cmdmap
, "fs_name", fs_name
) || fs_name
.empty()) {
1459 ss
<< "Missing filesystem name";
1463 auto fs
= fsmap
.get_filesystem(fs_name
);
1464 if (fs
== nullptr) {
1465 ss
<< "Filesystem '" << fs_name
<< "' not found";
1469 if (!fs
->mirror_info
.is_mirrored()) {
1470 ss
<< "Mirroring not enabled for filesystem '" << fs_name
<< "'";
1474 auto res
= peer_add(fsmap
, std::move(fs
), cmdmap
, ss
);
1483 class MirrorHandlerRemovePeer
: public FileSystemCommandHandler
1486 MirrorHandlerRemovePeer()
1487 : FileSystemCommandHandler("fs mirror peer_remove")
1490 bool peer_remove(FSMap
&fsmap
, Filesystem::const_ref
&&fs
,
1491 const cmdmap_t
&cmdmap
, std::ostream
&ss
) {
1493 cmd_getval(cmdmap
, "uuid", peer_uuid
);
1495 if (!fs
->mirror_info
.has_peer(peer_uuid
)) {
1496 ss
<< "cannot find peer with uuid: " << peer_uuid
;
1500 auto f
= [peer_uuid
](auto &&fs
) {
1501 fs
->mirror_info
.peer_remove(peer_uuid
);
1503 fsmap
.modify_filesystem(fs
->fscid
, std::move(f
));
1507 int handle(Monitor
*mon
,
1508 FSMap
&fsmap
, MonOpRequestRef op
,
1509 const cmdmap_t
& cmdmap
, std::ostream
&ss
) override
{
1510 std::string fs_name
;
1511 if (!cmd_getval(cmdmap
, "fs_name", fs_name
) || fs_name
.empty()) {
1512 ss
<< "Missing filesystem name";
1516 auto fs
= fsmap
.get_filesystem(fs_name
);
1517 if (fs
== nullptr) {
1518 ss
<< "Filesystem '" << fs_name
<< "' not found";
1522 if (!fs
->mirror_info
.is_mirrored()) {
1523 ss
<< "Mirroring not enabled for filesystem '" << fs_name
<< "'";
1527 auto res
= peer_remove(fsmap
, std::move(fs
), cmdmap
, ss
);
1536 std::list
<std::shared_ptr
<FileSystemCommandHandler
> >
1537 FileSystemCommandHandler::load(Paxos
*paxos
)
1539 std::list
<std::shared_ptr
<FileSystemCommandHandler
> > handlers
;
1541 handlers
.push_back(std::make_shared
<SetHandler
>());
1542 handlers
.push_back(std::make_shared
<FailHandler
>());
1543 handlers
.push_back(std::make_shared
<FlagSetHandler
>());
1544 handlers
.push_back(std::make_shared
<CompatSetHandler
>());
1545 handlers
.push_back(std::make_shared
<RequiredClientFeaturesHandler
>());
1546 handlers
.push_back(std::make_shared
<AddDataPoolHandler
>(paxos
));
1547 handlers
.push_back(std::make_shared
<RemoveDataPoolHandler
>());
1548 handlers
.push_back(std::make_shared
<FsNewHandler
>(paxos
));
1549 handlers
.push_back(std::make_shared
<RemoveFilesystemHandler
>());
1550 handlers
.push_back(std::make_shared
<ResetFilesystemHandler
>());
1551 handlers
.push_back(std::make_shared
<RenameFilesystemHandler
>(paxos
));
1553 handlers
.push_back(std::make_shared
<SetDefaultHandler
>());
1554 handlers
.push_back(std::make_shared
<AliasHandler
<SetDefaultHandler
> >(
1556 handlers
.push_back(std::make_shared
<MirrorHandlerEnable
>());
1557 handlers
.push_back(std::make_shared
<MirrorHandlerDisable
>());
1558 handlers
.push_back(std::make_shared
<MirrorHandlerAddPeer
>());
1559 handlers
.push_back(std::make_shared
<MirrorHandlerRemovePeer
>());
1564 int FileSystemCommandHandler::_check_pool(
1566 const int64_t pool_id
,
1570 bool allow_overlay
) const
1572 ceph_assert(ss
!= NULL
);
1574 const pg_pool_t
*pool
= osd_map
.get_pg_pool(pool_id
);
1576 *ss
<< "pool id '" << pool_id
<< "' does not exist";
1580 if (pool
->has_snaps()) {
1581 *ss
<< "pool(" << pool_id
<<") already has mon-managed snaps; "
1582 "can't attach pool to fs";
1586 const string
& pool_name
= osd_map
.get_pool_name(pool_id
);
1587 auto app_map
= pool
->application_metadata
;
1589 if (!allow_overlay
&& !force
&& !app_map
.empty()) {
1590 auto app
= app_map
.find(pg_pool_t::APPLICATION_NAME_CEPHFS
);
1591 if (app
!= app_map
.end()) {
1592 auto& [app_name
, app_metadata
] = *app
;
1593 auto itr
= app_metadata
.find("data");
1594 if (itr
== app_metadata
.end()) {
1595 itr
= app_metadata
.find("metadata");
1597 if (itr
!= app_metadata
.end()) {
1598 auto& [type
, filesystem
] = *itr
;
1599 *ss
<< "RADOS pool '" << pool_name
<< "' is already used by filesystem '"
1600 << filesystem
<< "' as a '" << type
<< "' pool for application '"
1605 *ss
<< "RADOS pool '" << pool_name
1606 << "' has another non-CephFS application enabled.";
1611 if (pool
->is_erasure()) {
1612 if (type
== POOL_METADATA
) {
1613 *ss
<< "pool '" << pool_name
<< "' (id '" << pool_id
<< "')"
1614 << " is an erasure-coded pool. Use of erasure-coded pools"
1615 << " for CephFS metadata is not permitted";
1617 } else if (type
== POOL_DATA_DEFAULT
&& !force
) {
1618 *ss
<< "pool '" << pool_name
<< "' (id '" << pool_id
<< "')"
1619 " is an erasure-coded pool."
1620 " Use of an EC pool for the default data pool is discouraged;"
1621 " see the online CephFS documentation for more information."
1622 " Use --force to override.";
1624 } else if (!pool
->allows_ecoverwrites()) {
1625 // non-overwriteable EC pools are only acceptable with a cache tier overlay
1626 if (!pool
->has_tiers() || !pool
->has_read_tier() || !pool
->has_write_tier()) {
1627 *ss
<< "pool '" << pool_name
<< "' (id '" << pool_id
<< "')"
1628 << " is an erasure-coded pool, with no overwrite support";
1632 // That cache tier overlay must be writeback, not readonly (it's the
1633 // write operations like modify+truncate we care about support for)
1634 const pg_pool_t
*write_tier
= osd_map
.get_pg_pool(
1636 ceph_assert(write_tier
!= NULL
); // OSDMonitor shouldn't allow DNE tier
1637 if (write_tier
->cache_mode
== pg_pool_t::CACHEMODE_FORWARD
1638 || write_tier
->cache_mode
== pg_pool_t::CACHEMODE_READONLY
) {
1639 *ss
<< "EC pool '" << pool_name
<< "' has a write tier ("
1640 << osd_map
.get_pool_name(pool
->write_tier
)
1641 << ") that is configured "
1642 "to forward writes. Use a cache mode such as 'writeback' for "
1649 if (pool
->is_tier()) {
1650 *ss
<< " pool '" << pool_name
<< "' (id '" << pool_id
1651 << "') is already in use as a cache tier.";
1655 if (!force
&& !pool
->application_metadata
.empty() &&
1656 pool
->application_metadata
.count(
1657 pg_pool_t::APPLICATION_NAME_CEPHFS
) == 0) {
1658 *ss
<< " pool '" << pool_name
<< "' (id '" << pool_id
1659 << "') has a non-CephFS application enabled.";
1663 if (type
!= POOL_METADATA
&& pool
->pg_autoscale_mode
== pg_pool_t::pg_autoscale_mode_t::ON
&& !pool
->has_flag(pg_pool_t::FLAG_BULK
)) {
1664 // TODO: consider issuing an info event in this case
1665 *ss
<< " Pool '" << pool_name
<< "' (id '" << pool_id
1666 << "') has pg autoscale mode 'on' but is not marked as bulk." << std::endl
1667 << " Consider setting the flag by running" << std::endl
1668 << " # ceph osd pool set " << pool_name
<< " bulk true" << std::endl
;
1671 // Nothing special about this pool, so it is permissible
1675 int FileSystemCommandHandler::is_op_allowed(
1676 const MonOpRequestRef
& op
, const FSMap
& fsmap
, const cmdmap_t
& cmdmap
,
1677 std::ostream
&ss
) const
1680 cmd_getval(cmdmap
, "fs_name", fs_name
);
1682 // so that fsmap can filtered and the original copy is untouched.
1683 FSMap fsmap_copy
= fsmap
;
1684 fsmap_copy
.filter(op
->get_session()->get_allowed_fs_names());
1686 auto fs
= fsmap_copy
.get_filesystem(fs_name
);
1687 if (fs
== nullptr) {
1688 auto prefix
= get_prefix();
1689 /* let "fs rm" and "fs rename" handle idempotent cases where file systems do not exist */
1690 if (!(prefix
== "fs rm" || prefix
== "fs rename") && fsmap
.get_filesystem(fs_name
) == nullptr) {
1691 ss
<< "Filesystem not found: '" << fs_name
<< "'";
1696 if (!op
->get_session()->fs_name_capable(fs_name
, MON_CAP_W
)) {
1697 ss
<< "Permission denied: '" << fs_name
<< "'";