Skip to content

Commit 063fb89

Browse files
authored
Merge pull request ceph#56287 from rzarzynski/wip-ec-profile-set-paranoid-on-override
mon, doc: overriding ec profile requires --yes-i-really-mean-it Reviewed-by: Josh Durgin <[email protected]>
2 parents 44a9b52 + 629ba7b commit 063fb89

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

doc/rados/operations/erasure-code-profile.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ Where:
9696
``--force``
9797

9898
:Description: Override an existing profile by the same name, and allow
99-
setting a non-4K-aligned stripe_unit.
99+
setting a non-4K-aligned stripe_unit. Overriding an existing
100+
profile can be dangerous, and thus ``--yes-i-really-mean-it``
101+
must be used as well.
100102

101103
:Type: String
102104
:Required: No.

src/mon/OSDMonitor.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11316,6 +11316,8 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
1131611316
err = 0;
1131711317
goto reply_no_propose;
1131811318
}
11319+
bool force_no_fake = false;
11320+
cmd_getval(cmdmap, "yes_i_really_mean_it", force_no_fake);
1131911321
if (!force) {
1132011322
err = -EPERM;
1132111323
ss << "will not override erasure code profile " << name
@@ -11324,6 +11326,11 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
1132411326
<< " is different from the proposed profile "
1132511327
<< profile_map;
1132611328
goto reply_no_propose;
11329+
} else if (!force_no_fake) {
11330+
err = -EPERM;
11331+
ss << "overriding erasure code profile can be DANGEROUS"
11332+
<< "; add --yes-i-really-mean-it to do it anyway";
11333+
goto reply_no_propose;
1132711334
}
1132811335
}
1132911336

0 commit comments

Comments
 (0)