From: Patrick Donnelly Date: Fri, 8 Jan 2021 20:10:28 +0000 (-0800) Subject: mon/FSCommands: restore idempotent behavior of fs rm X-Git-Tag: v17.0.0~85^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e4d826d7a0d8489bc777ac3ad2229f95cde96d94;p=ceph-ci.git mon/FSCommands: restore idempotent behavior of fs rm Fixes: https://tracker.ceph.com/issues/48808 Fixes: 811e48d6ffd841ecd93a57eb00c6aceae476f4f8 Signed-off-by: Patrick Donnelly --- diff --git a/src/mon/FSCommands.cc b/src/mon/FSCommands.cc index 058148a95fa..a401cc78658 100644 --- a/src/mon/FSCommands.cc +++ b/src/mon/FSCommands.cc @@ -1355,8 +1355,11 @@ int FileSystemCommandHandler::is_op_allowed( auto fs = fsmap_copy.get_filesystem(fs_name); if (fs == nullptr) { - ss << "Filesystem not found: '" << fs_name << "'"; - return -ENOENT; + /* let "fs rm" handle idempotent case where file system does not exist */ + if (!(get_prefix() == "fs rm" && fsmap.get_filesystem(fs_name) == nullptr)) { + ss << "Filesystem not found: '" << fs_name << "'"; + return -ENOENT; + } } if (!op->get_session()->fs_name_capable(fs_name, MON_CAP_W)) {