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: v11.0.0~149^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a54073808146d205d54d6a932a6e0fd750f1dc38;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 --- diff --git a/src/librbd/AioObjectRequest.cc b/src/librbd/AioObjectRequest.cc index 77aaa7e1f61..f2303010a5d 100644 --- a/src/librbd/AioObjectRequest.cc +++ b/src/librbd/AioObjectRequest.cc @@ -538,7 +538,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()); }