]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
librbd/io: send alloc_hint when compression hint is set
authorJason Dillaman <dillaman@redhat.com>
Fri, 12 Mar 2021 00:44:15 +0000 (19:44 -0500)
committerJason Dillaman <dillaman@redhat.com>
Fri, 12 Mar 2021 00:44:15 +0000 (19:44 -0500)
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>
src/librbd/io/ObjectRequest.cc

index e4ee152cf36f1abae4fc4a2d606920f3d46920ca..87c3cd7dd5289acb1f4368710eda768804f0007a 100644 (file)
@@ -399,7 +399,8 @@ void AbstractObjectWriteRequest<I>::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<I>::add_write_hint(*image_ctx, wr);
   }
 }