From: xinxin shu Date: Wed, 24 Feb 2016 10:34:46 +0000 (+0800) Subject: librbd: Truncate of non-existent object results in object map flagged as exists X-Git-Tag: v10.1.0~188^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0c27417d861ca9b28fc2f4a12f8bb896d9a51580;p=ceph.git librbd: Truncate of non-existent object results in object map flagged as exists Fixes: #14789 Signed-off-by: xinxin shu --- diff --git a/src/librbd/AioObjectRequest.h b/src/librbd/AioObjectRequest.h index 7aa06c1d5c59..be9ba70cd13d 100644 --- a/src/librbd/AioObjectRequest.h +++ b/src/librbd/AioObjectRequest.h @@ -318,7 +318,10 @@ namespace librbd { } virtual void pre_object_map_update(uint8_t *new_state) { - *new_state = OBJECT_EXISTS; + if (!m_object_exist && !has_parent()) + *new_state = OBJECT_NONEXISTENT; + else + *new_state = OBJECT_EXISTS; } };