]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: clear extent map on object removal 11603/head
authorSage Weil <sage@redhat.com>
Fri, 21 Oct 2016 19:42:19 +0000 (15:42 -0400)
committerSage Weil <sage@redhat.com>
Fri, 21 Oct 2016 19:42:28 +0000 (15:42 -0400)
Clear ExtentMap (esp shards, etc.) when an object is removed.  Otherwise
if we recreate it we will have stale state (like the shards vector or
inline_bl) that are bogus.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index e1fd1f8b32113814b6d47a9536f74b0c65e2e4a4..8cb34e6ebf6efa3eb81d4e482e3d92b2579d2336 100644 (file)
@@ -8122,6 +8122,7 @@ int BlueStore::_do_remove(
     txc->t->rmkey(PREFIX_OBJ, s.key);
   }
   txc->t->rmkey(PREFIX_OBJ, o->key);
+  o->extent_map.clear();
   _debug_obj_on_delete(o->oid);
   return 0;
 }
index 39ddef7a712486abc05117bf6f17432d601a450c..fc2f6900d41f6ea035520537ac884e39be898958 100644 (file)
@@ -604,6 +604,14 @@ public:
       extent_map.clear_and_dispose([&](Extent *e) { delete e; });
     }
 
+    void clear() {
+      extent_map.clear();
+      extent_map.clear_and_dispose([&](Extent *e) { delete e; });
+      shards.clear();
+      inline_bl.clear();
+      needs_reshard = false;
+    }
+
     bool encode_some(uint32_t offset, uint32_t length, bufferlist& bl,
                     unsigned *pn);
     void decode_some(bufferlist& bl);