summaryrefslogtreecommitdiffstats
path: root/src/os/bluestore/BlueStore.cc
diff options
context:
space:
mode:
authorSage Weil <sage@redhat.com>2018-08-13 20:00:36 +0200
committerSage Weil <sage@redhat.com>2018-08-13 20:00:36 +0200
commit4c2591b5d30a806b0a9195aea96e6d984b563411 (patch)
tree0b8a8df6c45e1699c111c4c69c7c6578232c09e2 /src/os/bluestore/BlueStore.cc
parentMerge PR #23517 into master (diff)
parentos/bluestore: check bluefs_extents consistency (DB vs. BlueFS) (diff)
downloadceph-4c2591b5d30a806b0a9195aea96e6d984b563411.tar.xz
ceph-4c2591b5d30a806b0a9195aea96e6d984b563411.zip
Merge PR #23516 into master
* refs/pull/23516/head: os/bluestore: check bluefs_extents consistency (DB vs. BlueFS) Reviewed-by: Sage Weil <sage@redhat.com>
Diffstat (limited to 'src/os/bluestore/BlueStore.cc')
-rw-r--r--src/os/bluestore/BlueStore.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc
index 9c8f0ecafaf..c3d783ec801 100644
--- a/src/os/bluestore/BlueStore.cc
+++ b/src/os/bluestore/BlueStore.cc
@@ -6118,6 +6118,26 @@ int BlueStore::_fsck(bool deep, bool repair)
}
if (bluefs) {
+ interval_set<uint64_t> bset;
+ r = bluefs->get_block_extents(bluefs_shared_bdev, &bset);
+ assert(r == 0);
+ if (!(bset == bluefs_extents)) {
+ dout(10) << __func__ << " bluefs says 0x" << std::hex << bset << std::dec
+ << dendl;
+ dout(10) << __func__ << " super says 0x" << std::hex << bluefs_extents
+ << std::dec << dendl;
+
+ interval_set<uint64_t> overlap;
+ overlap.intersection_of(bset, bluefs_extents);
+
+ bset.subtract(overlap);
+ if (!bset.empty()) {
+ derr << "fsck error: bluefs extra 0x" << std::hex << bset << std::dec
+ << dendl;
+ ++errors;
+ }
+ }
+
for (auto e = bluefs_extents.begin(); e != bluefs_extents.end(); ++e) {
apply(
e.get_start(), e.get_len(), fm->get_alloc_size(), used_blocks,