Merge pull request #40050 from dillaman/wip-49690

librbd/io: send alloc_hint when compression hint is set

Reviewed-by: Mykola Golub <mgolub@suse.com>
This commit is contained in:
Mykola Golub 2021-03-12 19:50:04 +02:00 committed by GitHub
commit e7c6384bf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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);
}
}