summaryrefslogtreecommitdiffstats
path: root/src/os
diff options
context:
space:
mode:
authorAdam Kupczyk <akupczyk@ibm.com>2024-10-18 17:56:46 +0200
committerGitHub <noreply@github.com>2024-10-18 17:56:46 +0200
commit4b542157008d69fefd24ac9a59426d015a6df1aa (patch)
treeaf9c1e2602d91ec1c904198ebdffdd1c28b08b02 /src/os
parentMerge pull request #59420 from rishabh-d-dave/max-mds-confirm (diff)
parentos/bluestore: Fix repair of multilabel when collides with BlueFS (diff)
downloadceph-4b542157008d69fefd24ac9a59426d015a6df1aa.tar.xz
ceph-4b542157008d69fefd24ac9a59426d015a6df1aa.zip
Merge pull request #60323 from aclamk/wip-aclamk-fix-68528
os/bluestore: Fix repair of multilabel when collides with BlueFS
Diffstat (limited to 'src/os')
-rw-r--r--src/os/bluestore/BlueStore.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc
index 58234d22d25..535cf166f0a 100644
--- a/src/os/bluestore/BlueStore.cc
+++ b/src/os/bluestore/BlueStore.cc
@@ -6794,9 +6794,8 @@ void BlueStore::_main_bdev_label_try_reserve()
vector<uint64_t> candidate_positions;
vector<uint64_t> accepted_positions;
uint64_t lsize = std::max(BDEV_LABEL_BLOCK_SIZE, min_alloc_size);
- for (size_t i = 1; i < bdev_label_positions.size(); i++) {
- uint64_t location = bdev_label_positions[i];
- if (location + lsize <= bdev->get_size()) {
+ for (uint64_t location : bdev_label_valid_locations) {
+ if (location != BDEV_FIRST_LABEL_POSITION) {
candidate_positions.push_back(location);
}
}
@@ -11497,9 +11496,7 @@ int BlueStore::_fsck_on_open(BlueStore::FSCKDepth depth, bool repair)
string p = path + "/block";
_write_bdev_label(cct, bdev, p, bdev_label, bdev_labels_in_repair);
for (uint64_t pos : bdev_labels_in_repair) {
- if (pos != BDEV_FIRST_LABEL_POSITION) {
- bdev_label_valid_locations.push_back(pos);
- }
+ bdev_label_valid_locations.push_back(pos);
}
repaired += bdev_labels_in_repair.size();
}