Skip to content

Commit

Permalink
mon: remove 'mds setmap' command
Browse files Browse the repository at this point in the history
This command has no discernable purpose, and is difficult and
dangerous to support anyway.

Fixes: #15136
Signed-off-by: Sage Weil <sage@redhat.com>
  • Loading branch information
liewegas committed Mar 15, 2016
1 parent 6a80e2d commit 026cf37
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 44 deletions.
4 changes: 0 additions & 4 deletions doc/cephfs/administration.rst
Expand Up @@ -103,10 +103,6 @@ filesystem.

mds compat show

::

mds setmap

::

mds getmap
Expand Down
8 changes: 1 addition & 7 deletions doc/man/8/ceph.rst
Expand Up @@ -33,7 +33,7 @@ Synopsis
| **ceph** **log** *<logtext>* [ *<logtext>*... ]
| **ceph** **mds** [ *add_data_pool* \| *cluster_down* \| *cluster_up* \| *compat* \| *deactivate* \| *dump* \| *fail* \| *getmap* \| *newfs* \| *remove_data_pool* \| *rm* \| *rmfailed* \| *set* \| *set_max_mds* \| *set_state* \| *setmap* \| *stat* \| *stop* \| *tell* ] ...
| **ceph** **mds** [ *add_data_pool* \| *cluster_down* \| *cluster_up* \| *compat* \| *deactivate* \| *dump* \| *fail* \| *getmap* \| *newfs* \| *remove_data_pool* \| *rm* \| *rmfailed* \| *set* \| *set_max_mds* \| *set_state* \| *stat* \| *stop* \| *tell* ] ...
| **ceph** **mon** [ *add* \| *dump* \| *getmap* \| *remove* \| *stat* ] ...
Expand Down Expand Up @@ -433,12 +433,6 @@ Usage::

ceph mds set_state <int[0-]> <int[0-20]>

Subcommand ``setmap`` sets mds map; must supply correct epoch number.

Usage::

ceph mds setmap <int[0-]>

Subcommand ``stat`` shows MDS status.

Usage::
Expand Down
29 changes: 0 additions & 29 deletions src/mon/MDSMonitor.cc
Expand Up @@ -2135,35 +2135,6 @@ int MDSMonitor::filesystem_command(
info->state = MDSMap::STATE_STOPPING;
});
}
} else if (prefix == "mds setmap") {
string confirm;
if (!cmd_getval(g_ceph_context, cmdmap, "confirm", confirm) ||
confirm != "--yes-i-really-mean-it") {
ss << "WARNING: this can make your filesystem inaccessible! "
"Add --yes-i-really-mean-it if you are sure you wish to continue.";
return -EINVAL;;
}

FSMap map;
try {
map.decode(m->get_data());
} catch(buffer::error &e) {
ss << "invalid mdsmap";
return -EINVAL;
}
epoch_t e = 0;
int64_t epochnum;
if (cmd_getval(g_ceph_context, cmdmap, "epoch", epochnum))
e = epochnum;

if (pending_fsmap.epoch == e) {
map.epoch = pending_fsmap.epoch; // make sure epoch is correct
pending_fsmap = map;
ss << "set mds map";
} else {
ss << "next fsmap epoch " << pending_fsmap.epoch << " != " << e;
return -EINVAL;
}
} else if (prefix == "mds set_state") {
mds_gid_t gid;
if (!cmd_getval(g_ceph_context, cmdmap, "gid", gid)) {
Expand Down
4 changes: 0 additions & 4 deletions src/mon/MonCommands.h
Expand Up @@ -329,10 +329,6 @@ COMMAND("mds set " \
"name=val,type=CephString " \
"name=confirm,type=CephString,req=false", \
"set mds parameter <var> to <val>", "mds", "rw", "cli,rest")
COMMAND("mds setmap " \
"name=epoch,type=CephInt,range=0 " \
"name=confirm,type=CephString,req=false",
"set mds map; must supply correct epoch number", "mds", "rw", "cli,rest")
// arbitrary limit 0-20 below; worth standing on head to make it
// relate to actual state definitions?
// #include "include/ceph_fs.h"
Expand Down

0 comments on commit 026cf37

Please sign in to comment.