Skip to content

Commit

Permalink
mon: OSDMonitor: don't remove unamanaged snaps from not-unmanaged pools
Browse files Browse the repository at this point in the history
Although we should allow creating unmanaged snaps on not-unamanaged pools,
as long as those pools don't have any managed snapshots in them, we cannot
allow removal -- because the pool will not have any unmanaged snapshots.

Fixes: 7210

Signed-off-by: Joao Eduardo Luis <[email protected]>
  • Loading branch information
Joao Eduardo Luis committed Mar 7, 2014
1 parent 8221a8e commit c13e1b7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/mon/OSDMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4964,8 +4964,16 @@ bool OSDMonitor::prepare_pool_op(MPoolOp *m)
_pool_op_reply(m, ret, osdmap.get_epoch());
return false;

case POOL_OP_CREATE_UNMANAGED_SNAP:
case POOL_OP_DELETE_UNMANAGED_SNAP:
// we won't allow removal of an unmanaged snapshot from a pool
// not in unmanaged snaps mode.
if (!pool->is_unmanaged_snaps_mode()) {
_pool_op_reply(m, -ENOTSUP, osdmap.get_epoch());
return false;
}
case POOL_OP_CREATE_UNMANAGED_SNAP:
// but we will allow creating an unmanaged snapshot on any pool
// as long as it is not in 'pool' snaps mode.
if (pool->is_pool_snaps_mode()) {
_pool_op_reply(m, -EINVAL, osdmap.get_epoch());
return false;
Expand Down

0 comments on commit c13e1b7

Please sign in to comment.