Skip to content

Commit

Permalink
Merge pull request ceph#56587 from tchaikov/wip-bluefs-use-after-free
Browse files Browse the repository at this point in the history
test/objectstore/test_bluefs: fix heap-use-after-free

Reviewed-by: Igor Fedotov <[email protected]>
  • Loading branch information
tchaikov authored Mar 30, 2024
2 parents 2ecf63a + b8c30a7 commit ddbc0e9
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/test/objectstore/test_bluefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1174,13 +1174,19 @@ TEST(BlueFS, test_shared_alloc) {
}
}
fs.compact_log();
auto *logger = fs.get_perf_counters();
ASSERT_NE(logger->get(l_bluefs_alloc_shared_dev_fallbacks), 0);
auto num_files = logger->get(l_bluefs_num_files);
fs.umount();
fs.mount();
ASSERT_EQ(num_files, logger->get(l_bluefs_num_files));
fs.umount();
uint64_t num_files = 0;
{
auto *logger = fs.get_perf_counters();
ASSERT_NE(logger->get(l_bluefs_alloc_shared_dev_fallbacks), 0);
num_files = logger->get(l_bluefs_num_files);
fs.umount();
}
{
fs.mount();
auto *logger = fs.get_perf_counters();
ASSERT_EQ(num_files, logger->get(l_bluefs_num_files));
fs.umount();
}
}

TEST(BlueFS, test_shared_alloc_sparse) {
Expand Down

0 comments on commit ddbc0e9

Please sign in to comment.