]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd/io: send alloc_hint when compression hint is set 40386/head
authorJason Dillaman <dillaman@redhat.com>
Fri, 12 Mar 2021 00:44:15 +0000 (19:44 -0500)
committersinguliere <singuliere@autistici.org>
Wed, 24 Mar 2021 20:39:47 +0000 (21:39 +0100)
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 <dillaman@redhat.com>
(cherry picked from commit b52b5fe06d1f88130b72b8357dbf5630c7cf1cbd)

src/librbd/io/ObjectRequest.cc

index ffd21dfc617e6b44b65d1609ae04f6a776fdfa7a..0bf2fb2e9a771c031decf53c0984207e73b038d3 100644 (file)
@@ -371,7 +371,8 @@ void AbstractObjectWriteRequest<I>::add_write_hint(
     librados::ObjectWriteOperation *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<I>::add_write_hint(*image_ctx, wr);
   }
 }