From d65e22d27ab305d38059046dae60d7a66ff4a4e0 Mon Sep 17 00:00:00 2001 From: Qiaowei Ren Date: Tue, 11 Sep 2018 10:54:20 +0800 Subject: ceph: shared persistent read-only rbd cache This patch introduces introduces RBD shared persistent RO cache which can provide client-side sharing cache for rbd clone/snapshot case. Change-Id: Icad8063f4f10b1ab4ce31920e90d5affa7d0abdc Signed-off-by: Qiaowei Ren Signed-off-by: Dehao Shang Signed-off-by: Tushar Gohad Signed-off-by: Jason Dillaman Signed-off-by: Yuan Zhou --- .../0004-librbd-fix-lookup-object-return.patch | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/ceph/0004-librbd-fix-lookup-object-return.patch (limited to 'src/ceph/0004-librbd-fix-lookup-object-return.patch') diff --git a/src/ceph/0004-librbd-fix-lookup-object-return.patch b/src/ceph/0004-librbd-fix-lookup-object-return.patch new file mode 100644 index 0000000..0a2e2eb --- /dev/null +++ b/src/ceph/0004-librbd-fix-lookup-object-return.patch @@ -0,0 +1,45 @@ +From 779ef67e6a401ad569c5d3d3a076352db8ad0f67 Mon Sep 17 00:00:00 2001 +From: Yuan Zhou +Date: Mon, 6 Aug 2018 15:47:23 +0800 +Subject: [PATCH 04/10] librbd: fix lookup object return + +Signed-off-by: Yuan Zhou +--- + src/tools/rbd_cache/CacheControllerSocketClient.hpp | 7 ++++++- + src/tools/rbd_cache/CacheControllerSocketCommon.h | 2 +- + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/src/tools/rbd_cache/CacheControllerSocketClient.hpp b/src/tools/rbd_cache/CacheControllerSocketClient.hpp +index 57be78e..4e1f36c 100644 +--- a/src/tools/rbd_cache/CacheControllerSocketClient.hpp ++++ b/src/tools/rbd_cache/CacheControllerSocketClient.hpp +@@ -99,7 +99,12 @@ public: + boost::asio::transfer_exactly(544), + [this, result](const boost::system::error_code& err, size_t cb) { + if (!err) { +- *result = true; ++ rbdsc_req_type_t *io_ctx = (rbdsc_req_type_t*)(buffer_); ++ if (io_ctx->type == RBDSC_READ_REPLY) { ++ *result = true; ++ } else { ++ *result = false; ++ } + cv.notify_one(); + m_client_process_msg(std::string(buffer_, cb)); + } else { +diff --git a/src/tools/rbd_cache/CacheControllerSocketCommon.h b/src/tools/rbd_cache/CacheControllerSocketCommon.h +index ab89155..a9d73a8 100644 +--- a/src/tools/rbd_cache/CacheControllerSocketCommon.h ++++ b/src/tools/rbd_cache/CacheControllerSocketCommon.h +@@ -10,7 +10,7 @@ + #define RBDSC_REGISTER_REPLY 0X14 + #define RBDSC_READ_REPLY 0X15 + #define RBDSC_LOOKUP_REPLY 0X16 +-#define RBDSC_READ_RADOS 0X16 ++#define RBDSC_READ_RADOS 0X17 + + namespace rbd { + namespace cache { +-- +2.7.4 + -- cgit 1.2.3-korg