Skip to content

Commit 4b54215

Browse files
authored
Merge pull request ceph#60323 from aclamk/wip-aclamk-fix-68528
os/bluestore: Fix repair of multilabel when collides with BlueFS
2 parents 8978b85 + 7343be7 commit 4b54215

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/os/bluestore/BlueStore.cc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6794,9 +6794,8 @@ void BlueStore::_main_bdev_label_try_reserve()
67946794
vector<uint64_t> candidate_positions;
67956795
vector<uint64_t> accepted_positions;
67966796
uint64_t lsize = std::max(BDEV_LABEL_BLOCK_SIZE, min_alloc_size);
6797-
for (size_t i = 1; i < bdev_label_positions.size(); i++) {
6798-
uint64_t location = bdev_label_positions[i];
6799-
if (location + lsize <= bdev->get_size()) {
6797+
for (uint64_t location : bdev_label_valid_locations) {
6798+
if (location != BDEV_FIRST_LABEL_POSITION) {
68006799
candidate_positions.push_back(location);
68016800
}
68026801
}
@@ -11497,9 +11496,7 @@ int BlueStore::_fsck_on_open(BlueStore::FSCKDepth depth, bool repair)
1149711496
string p = path + "/block";
1149811497
_write_bdev_label(cct, bdev, p, bdev_label, bdev_labels_in_repair);
1149911498
for (uint64_t pos : bdev_labels_in_repair) {
11500-
if (pos != BDEV_FIRST_LABEL_POSITION) {
11501-
bdev_label_valid_locations.push_back(pos);
11502-
}
11499+
bdev_label_valid_locations.push_back(pos);
1150311500
}
1150411501
repaired += bdev_labels_in_repair.size();
1150511502
}

0 commit comments

Comments
 (0)