Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed WOP stability issues #57

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions target/core/block_allocator/bitmap_allocator/bitmap_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ class QwordVector64Cell : public AllocatorType::BitMap,
* in a given cell of the bitmap. This behaves like a get operation
* @ return a n-bit value inside the cell represented by uint8_t
*/
uint8_t operator[](int index) const {
int byte_index = index / cells_per_qword_;
int shift = (index % cells_per_qword_) * bits_per_cell_;
uint8_t operator[](uint64_t index) const {
uint64_t byte_index = index / cells_per_qword_;
uint64_t shift = (index % cells_per_qword_) * bits_per_cell_;
return (data_[byte_index] >> shift) & read_cell_flag_;
}

Expand Down
16 changes: 7 additions & 9 deletions target/core/kvtrans/formatter/formatter_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ void Formatter::format_bdev_read_super_complete_cb(
}

// Free all the super block memory allocated
free(read_sb);
free(Formatter::written_super_block);
spdk_dma_free(read_sb);
spdk_dma_free(Formatter::written_super_block);


// Try to exit application
Expand Down Expand Up @@ -324,8 +324,8 @@ bool Formatter::read_and_print_super_block(

if (rc != 0) {
assert(("ERROR", false));
free(super_block);
free(Formatter::written_super_block);
spdk_dma_free(super_block);
spdk_dma_free(Formatter::written_super_block);
// return false;
}

Expand All @@ -346,7 +346,7 @@ void Formatter::format_bdev_write_super_complete_cb(
// Assert for now
assert(("ERROR", false));
// Free memory allocated for super_block
free(Formatter::written_super_block);
spdk_dma_free(Formatter::written_super_block);
// Free payload
delete payload;
}
Expand All @@ -357,7 +357,7 @@ void Formatter::format_bdev_write_super_complete_cb(
Formatter::read_and_print_super_block(payload);
} else {
// Free memory allocated for super_block
free(Formatter::written_super_block);
spdk_dma_free(Formatter::written_super_block);
// Free payload
delete payload;
// Check for app stop
Expand Down Expand Up @@ -397,7 +397,6 @@ bool Formatter::format_device(bool is_debug) {

int rc = 0;
int num_blocks = 0;
//bool is_debug = true;

// This API assumes that the device is already opened and
// all relevant details are computed
Expand All @@ -413,7 +412,6 @@ bool Formatter::format_device(bool is_debug) {
this->bdev_super_block_physical_start_block_;
cb_payload->debug = is_debug;


// Build and write super block
dss_super_block_t *super_block =
(dss_super_block_t *)spdk_dma_zmalloc(
Expand Down Expand Up @@ -456,7 +454,7 @@ bool Formatter::format_device(bool is_debug) {
cb_payload);

if (rc != 0) {
free(super_block);
spdk_dma_free(super_block);
Formatter::written_super_block = nullptr;
delete cb_payload;
assert(("ERROR", false));
Expand Down
Loading