From b52b5fe06d1f88130b72b8357dbf5630c7cf1cbd Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Thu, 11 Mar 2021 19:44:15 -0500 Subject: [PATCH] librbd/io: send alloc_hint when compression hint is set Previously the hint would not be set if the object map indicated the object may exist. Fixes: https://tracker.ceph.com/issues/49690 Signed-off-by: Jason Dillaman --- src/librbd/io/ObjectRequest.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librbd/io/ObjectRequest.cc b/src/librbd/io/ObjectRequest.cc index e4ee152cf36..87c3cd7dd52 100644 --- a/src/librbd/io/ObjectRequest.cc +++ b/src/librbd/io/ObjectRequest.cc @@ -399,7 +399,8 @@ void AbstractObjectWriteRequest::add_write_hint( neorados::WriteOp *wr) { I *image_ctx = this->m_ictx; std::shared_lock image_locker{image_ctx->image_lock}; - if (image_ctx->object_map == nullptr || !this->m_object_may_exist) { + if (image_ctx->object_map == nullptr || !this->m_object_may_exist || + image_ctx->alloc_hint_flags != 0U) { ObjectRequest::add_write_hint(*image_ctx, wr); } } -- 2.39.5