From nobody Sun Dec 05 18:13:31 2021 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 45D4D18B7524; Sun, 5 Dec 2021 18:13:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J6ZSD0Dw3z4dMV; Sun, 5 Dec 2021 18:13:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC1371C9AD; Sun, 5 Dec 2021 18:13:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B5IDVDM089899; Sun, 5 Dec 2021 18:13:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B5IDVAS089898; Sun, 5 Dec 2021 18:13:31 GMT (envelope-from git) Date: Sun, 5 Dec 2021 18:13:31 GMT Message-Id: <202112051813.1B5IDVAS089898@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dima Panov Subject: git: 9a397d866ef6 - main - net/ceph14: update to 14.2.22 release List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fluffy X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9a397d866ef68e8ef673633c08f2db4aad3018f0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638728012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GuMPXWi78Scn7pwU/Wora24pPBFAPXlc557YyZ2NyHE=; b=On66lIpYD0j26Wa+Kve3H+d+v0X6unfVBS4eE1mYvTYbRuhcxO2HTTwiAo7e172maV4MHb 1dRel6wvduaB+f1qLkdXdYTtbs1wQsIPoSeIrHpgD4M/yPPdWaFdKT5U2xILIu+eC/lMSf kuvG46Awt55rMkgv44pQprvI2HMFhvFdi+whLGrSHkl644JAJgJy76HBiKol7AtHIs2gKZ rE7U/kjgkApDHMibjksOmqAD1caiAddSGr4lXVUYKbkQo19Fnl23Lgmf8AZgdf/GYsAGeP RLW8v1bGObsKnWITnDrLHD1XRlI38oLTI8iaLLq6Yl/IvsruoXqwT7yb29x6lw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638728012; a=rsa-sha256; cv=none; b=IYtqrD58DeYxfKt76ZkSvacgy37M+9DtmyiXEc6O/EPyYiC6tYg0F2e91SMSaZgV4dkIye SFyAgA+G5dopPcpOeaeFGA4QsrzmwDfKxxqbAZFCMFbUzLK0LktZslbtzClGzBlDpf0rUU YjeYOBJAAW3NYGskBahiIhCyM//Yvx0rraGtQMYUEIFIhrEnsVpMmyLiBoHflRWDFYnil5 dxLC1oWWQBvqSYoU9Ei2lPjMWIlpdyjXyDK6Wkd1CbhSXI6WR+eKBZW3H9QXuAlEgqdP9R RKqH/KMlWZY8fkzfWxpqg42RkG39c1iIq0r+mMwxAqtLAYyOJMX0mzgl99SUOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fluffy: URL: https://cgit.FreeBSD.org/ports/commit/?id=9a397d866ef68e8ef673633c08f2db4aad3018f0 commit 9a397d866ef68e8ef673633c08f2db4aad3018f0 Author: Dima Panov AuthorDate: 2021-12-05 18:11:59 +0000 Commit: Dima Panov CommitDate: 2021-12-05 18:13:23 +0000 net/ceph14: update to 14.2.22 release Add missed patches. this is a followup to 30f5003a33ea --- net/ceph14/files/patch-src_librbd_api_Trash.cc | 180 +++++++++++++++++++++ .../files/patch-src_tools_rbd_action_Trash.cc | 22 +++ 2 files changed, 202 insertions(+) diff --git a/net/ceph14/files/patch-src_librbd_api_Trash.cc b/net/ceph14/files/patch-src_librbd_api_Trash.cc new file mode 100644 index 000000000000..44a54071009a --- /dev/null +++ b/net/ceph14/files/patch-src_librbd_api_Trash.cc @@ -0,0 +1,180 @@ +diff --git src/librbd/api/Trash.cc src/librbd/api/Trash.cc +index 52f79632d5..3d539ab1e2 100644 +--- src/librbd/api/Trash.cc ++++ src/librbd/api/Trash.cc +@@ -24,7 +24,6 @@ + #include + #include "librbd/journal/DisabledPolicy.h" + #include "librbd/image/ListWatchersRequest.h" +-#include + + #define dout_subsys ceph_subsys_rbd + #undef dout_prefix +@@ -124,48 +123,6 @@ int enable_mirroring(IoCtx &io_ctx, const std::string &image_id) { + return 0; + } + +-int list_trash_image_specs( +- librados::IoCtx &io_ctx, +- std::map* trash_image_specs, +- bool exclude_user_remove_source) { +- CephContext *cct((CephContext *)io_ctx.cct()); +- ldout(cct, 20) << "list_trash_image_specs " << &io_ctx << dendl; +- +- bool more_entries; +- uint32_t max_read = 1024; +- std::string last_read; +- do { +- std::map trash_entries; +- int r = cls_client::trash_list(&io_ctx, last_read, max_read, +- &trash_entries); +- if (r < 0 && r != -ENOENT) { +- lderr(cct) << "error listing rbd trash entries: " << cpp_strerror(r) +- << dendl; +- return r; +- } else if (r == -ENOENT) { +- break; +- } +- +- if (trash_entries.empty()) { +- break; +- } +- +- for (const auto &entry : trash_entries) { +- if (exclude_user_remove_source && +- entry.second.source == cls::rbd::TRASH_IMAGE_SOURCE_REMOVING) { +- continue; +- } +- +- trash_image_specs->insert({entry.first, entry.second}); +- } +- +- last_read = trash_entries.rbegin()->first; +- more_entries = (trash_entries.size() >= max_read); +- } while (more_entries); +- +- return 0; +-} +- + } // anonymous namespace + + template +@@ -281,37 +238,15 @@ int Trash::move(librados::IoCtx &io_ctx, rbd_trash_image_source_t source, + return -EOPNOTSUPP; + } + +- // search for an interrupted trash move request +- std::map trash_image_specs; +- int r = list_trash_image_specs(io_ctx, &trash_image_specs, true); +- if (r < 0) { +- return r; +- } +- +- std::experimental::erase_if( +- trash_image_specs, [image_name](const auto& pair) { +- const auto& spec = pair.second; +- return (spec.source != cls::rbd::TRASH_IMAGE_SOURCE_USER || +- spec.state != cls::rbd::TRASH_IMAGE_STATE_MOVING || +- spec.name != image_name); +- }); +- if (trash_image_specs.empty()) { +- return -ENOENT; +- } +- +- image_id = trash_image_specs.begin()->first; +- ldout(cct, 15) << "derived image id " << image_id << " from existing " +- << "trash entry" << dendl; ++ // image doesn't exist -- perhaps already in the trash since removing ++ // from the directory is the last step ++ return -ENOENT; + } else if (r < 0) { + lderr(cct) << "failed to retrieve image id: " << cpp_strerror(r) << dendl; + return r; + } + +- if (image_name.empty() || image_id.empty()) { +- lderr(cct) << "invalid image name/id" << dendl; +- return -EINVAL; +- } +- ++ ceph_assert(!image_name.empty() && !image_id.empty()); + return Trash::move(io_ctx, source, image_name, image_id, delay); + } + +@@ -342,23 +277,41 @@ template + int Trash::list(IoCtx &io_ctx, vector &entries, + bool exclude_user_remove_source) { + CephContext *cct((CephContext *)io_ctx.cct()); +- ldout(cct, 20) << __func__ << " " << &io_ctx << dendl; ++ ldout(cct, 20) << "trash_list " << &io_ctx << dendl; + +- std::map trash_image_specs; +- int r = list_trash_image_specs(io_ctx, &trash_image_specs, +- exclude_user_remove_source); +- if (r < 0) { +- return r; +- } ++ bool more_entries; ++ uint32_t max_read = 1024; ++ std::string last_read = ""; ++ do { ++ map trash_entries; ++ int r = cls_client::trash_list(&io_ctx, last_read, max_read, ++ &trash_entries); ++ if (r < 0 && r != -ENOENT) { ++ lderr(cct) << "error listing rbd trash entries: " << cpp_strerror(r) ++ << dendl; ++ return r; ++ } else if (r == -ENOENT) { ++ break; ++ } + +- entries.reserve(trash_image_specs.size()); +- for (const auto& [image_id, spec] : trash_image_specs) { +- rbd_trash_image_source_t source = +- static_cast(spec.source); +- entries.push_back({image_id, spec.name, source, +- spec.deletion_time.sec(), +- spec.deferment_end_time.sec()}); +- } ++ if (trash_entries.empty()) { ++ break; ++ } ++ ++ for (const auto &entry : trash_entries) { ++ rbd_trash_image_source_t source = ++ static_cast(entry.second.source); ++ if (exclude_user_remove_source && ++ source == RBD_TRASH_IMAGE_SOURCE_REMOVING) { ++ continue; ++ } ++ entries.push_back({entry.first, entry.second.name, source, ++ entry.second.deletion_time.sec(), ++ entry.second.deferment_end_time.sec()}); ++ } ++ last_read = trash_entries.rbegin()->first; ++ more_entries = (trash_entries.size() >= max_read); ++ } while (more_entries); + + return 0; + } +@@ -587,12 +540,8 @@ int Trash::remove(IoCtx &io_ctx, const std::string &image_id, bool force, + lderr(cct) << "error: deferment time has not expired." << dendl; + return -EPERM; + } +- if (trash_spec.state == cls::rbd::TRASH_IMAGE_STATE_MOVING) { +- lderr(cct) << "error: image is pending moving to the trash." +- << dendl; +- return -EUCLEAN; +- } else if (trash_spec.state != cls::rbd::TRASH_IMAGE_STATE_NORMAL && +- trash_spec.state != cls::rbd::TRASH_IMAGE_STATE_REMOVING) { ++ if (trash_spec.state != cls::rbd::TRASH_IMAGE_STATE_NORMAL && ++ trash_spec.state != cls::rbd::TRASH_IMAGE_STATE_REMOVING) { + lderr(cct) << "error: image is pending restoration." << dendl; + return -EBUSY; + } +@@ -750,3 +699,4 @@ int Trash::restore(librados::IoCtx &io_ctx, + } // namespace librbd + + template class librbd::api::Trash; ++ diff --git a/net/ceph14/files/patch-src_tools_rbd_action_Trash.cc b/net/ceph14/files/patch-src_tools_rbd_action_Trash.cc new file mode 100644 index 000000000000..65e9942f1c58 --- /dev/null +++ b/net/ceph14/files/patch-src_tools_rbd_action_Trash.cc @@ -0,0 +1,22 @@ +diff --git src/tools/rbd/action/Trash.cc src/tools/rbd/action/Trash.cc +index c4a17e4134..8b8fd8a322 100644 +--- src/tools/rbd/action/Trash.cc ++++ src/tools/rbd/action/Trash.cc +@@ -12,6 +12,7 @@ + * + */ + ++#include "include/compat.h" + #include "tools/rbd/ArgumentTypes.h" + #include "tools/rbd/Shell.h" + #include "tools/rbd/Utils.h" +@@ -145,9 +146,6 @@ int execute_remove(const po::variables_map &vm, + std::cerr << "rbd: image has snapshots - these must be deleted" + << " with 'rbd snap purge' before the image can be removed." + << std::endl; +- } else if (r == -EUCLEAN) { +- std::cerr << "rbd: error: image not fully moved to trash." +- << std::endl; + } else if (r == -EBUSY) { + std::cerr << "rbd: error: image still has watchers" + << std::endl