From 5bf4398e373ecc26958d8480171f4322341a9d82 Mon Sep 17 00:00:00 2001 From: xinxin shu Date: Tue, 7 Jun 2016 12:07:55 +0800 Subject: [PATCH] librbd: object_may_exist always return true when you write an empty object if you write an empty object, object map is updated firstly Signed-off-by: xinxin shu (cherry picked from commit a54073808146d205d54d6a932a6e0fd750f1dc38) --- src/librbd/AioObjectRequest.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librbd/AioObjectRequest.cc b/src/librbd/AioObjectRequest.cc index af34e8237ee93..f550b0b49785e 100644 --- a/src/librbd/AioObjectRequest.cc +++ b/src/librbd/AioObjectRequest.cc @@ -536,7 +536,7 @@ namespace librbd { RWLock::RLocker snap_locker(m_ictx->snap_lock); if (m_ictx->enable_alloc_hint && (m_ictx->object_map == nullptr || - !m_ictx->object_map->object_may_exist(m_object_no))) { + !m_object_exist)) { wr->set_alloc_hint(m_ictx->get_object_size(), m_ictx->get_object_size()); } -- 2.39.5