From: xinxin shu Date: Tue, 7 Jun 2016 04:07:55 +0000 (+0800) Subject: librbd: object_may_exist always return true when you write an empty object X-Git-Tag: v10.2.3~48^2~19 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5bf4398e373ecc26958d8480171f4322341a9d82;p=ceph.git 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) --- 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()); }