]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: Truncate of non-existent object results in object map flagged as exists
authorxinxin shu <xinxin.shu@intel.com>
Wed, 24 Feb 2016 10:34:46 +0000 (18:34 +0800)
committerxinxin shu <xinxin.shu@intel.com>
Thu, 25 Feb 2016 02:36:13 +0000 (10:36 +0800)
Fixes: #14789
Signed-off-by: xinxin shu <xinxin.shu@intel.com>
src/librbd/AioObjectRequest.h

index 7aa06c1d5c593fabdafadb800cdb91370178dd37..be9ba70cd13d76d6c9d2b25a4fd1f45b39a24be6 100644 (file)
@@ -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;
     }
   };