Skip to content

Commit 7fcd9cb

Browse files
authored
Merge pull request ceph#61470 from aclamk/wip-aclamk-bluefs-bdev-expand-addendum
os/bluestore: CBT bluefs-bdev-expand addendum
2 parents 27c7b1f + 8c28695 commit 7fcd9cb

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

qa/standalone/osd/osd-bluefs-volume-ops.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ function TEST_bluestore() {
3333
CEPH_ARGS+="--bluestore_block_wal_size=536870912 "
3434
CEPH_ARGS+="--bluestore_block_wal_create=true "
3535
CEPH_ARGS+="--bluestore_fsck_on_mount=true "
36+
#choosing randomly allocation from file
37+
CEPH_ARGS+="--bluestore_allocation_from_file=$((RANDOM % 2)) "
3638

3739
run_mon $dir a || return 1
3840
run_mgr $dir x || return 1
@@ -465,7 +467,7 @@ function TEST_bluestore_expand() {
465467
total_space_after=$( ceph tell osd.0 perf dump bluefs | jq ".bluefs.slow_total_bytes" )
466468
free_space_after=`ceph tell osd.0 bluestore bluefs device info | grep "BDEV_SLOW" -A 2 | grep free | cut -d':' -f 2 | cut -d"," -f 1 | cut -d' ' -f 2`
467469

468-
if [$total_space_after != $requested_space]; then
470+
if [ $total_space_after != $requested_space ]; then
469471
echo "total_space_after = $total_space_after"
470472
echo "requested_space = $requested_space"
471473
return 1;

src/os/bluestore/BlueStore.cc

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6684,10 +6684,8 @@ int BlueStore::_read_bdev_label(
66846684
decode(expected_crc, p);
66856685
}
66866686
catch (ceph::buffer::error& e) {
6687-
derr << __func__ << " unable to decode label " << path.c_str()
6688-
<< " at offset " << p.get_off()
6689-
<< ": " << e.what()
6690-
<< dendl;
6687+
derr << __func__ << " " << path.c_str() << " data at " << std::hex << disk_position
6688+
<< std::dec << ", " << "unable to decode label " << dendl;
66916689
return -ENOENT;
66926690
}
66936691
if (crc != expected_crc) {
@@ -8974,6 +8972,15 @@ int BlueStore::expand_devices(ostream& out)
89748972
<< " : size label updated to " << size
89758973
<< std::endl;
89768974
}
8975+
if (bdev_label_multi) {
8976+
uint64_t lsize = std::max(BDEV_LABEL_BLOCK_SIZE, min_alloc_size);
8977+
for (uint64_t loc : bdev_label_positions) {
8978+
if ((loc >= size0) && (loc + lsize <= size)) {
8979+
bdev_label_valid_locations.push_back(loc);
8980+
}
8981+
}
8982+
_write_bdev_label(cct, bdev, path + "/block", bdev_label, bdev_label_valid_locations);
8983+
}
89778984
}
89788985
_close_db_and_around();
89798986

@@ -8988,15 +8995,6 @@ int BlueStore::expand_devices(ostream& out)
89888995
if (fm && fm->is_null_manager()) {
89898996
// we grow the allocation range, must reflect it in the allocation file
89908997
alloc->init_add_free(size0, size - size0);
8991-
if (bdev_label_multi) {
8992-
uint64_t lsize = std::max(BDEV_LABEL_BLOCK_SIZE, min_alloc_size);
8993-
for (uint64_t loc : bdev_label_positions) {
8994-
if ((loc >= size0) && (loc + lsize <= size)) {
8995-
bdev_label_valid_locations.push_back(loc);
8996-
}
8997-
}
8998-
_write_bdev_label(cct, bdev, path + "/block", bdev_label, bdev_label_valid_locations);
8999-
}
90008998
need_to_destage_allocation_file = true;
90018999
}
90029000
umount();

0 commit comments

Comments
 (0)