From: Igor Fedotov Date: Wed, 14 Mar 2018 16:49:44 +0000 (+0300) Subject: os/bluestore: bluestore repair should use interval_set::union_insert X-Git-Tag: wip-pdonnell-testing-20180329.205607~46^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=62777c5db04ab2560168fa892bc881533d591f7a;p=ceph-ci.git os/bluestore: bluestore repair should use interval_set::union_insert method rather than insert one to handle intersecting/overlapping ranges. Signed-off-by: Igor Fedotov --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 71ad7267e64..fa2ac290a8f 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -6463,7 +6463,7 @@ int BlueStore::_fsck(bool deep, bool repair) // relying on blob's pextents to decide what to release. for (auto& p : pext_to_release) { - to_release.insert(p.offset, p.length); + to_release.union_insert(p.offset, p.length); } } else { for (auto& p : pext_to_release) { @@ -6471,7 +6471,7 @@ int BlueStore::_fsck(bool deep, bool repair) if (compressed) { expected_statfs.compressed_allocated -= p.length; } - to_release.insert(p.offset, p.length); + to_release.union_insert(p.offset, p.length); } } if (bypass_rest) { diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index f0b6bc00e9d..83cbd179633 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -2815,7 +2815,7 @@ public: unsigned apply(KeyValueDB* db); void note_misreference(uint64_t offs, uint64_t len, bool inc_error) { - misreferenced_extents.insert(offs, len); + misreferenced_extents.union_insert(offs, len); if (inc_error) { ++to_repair_cnt; }