Skip to content

Commit

Permalink
Fix fallocate call to use get_value() for new file size calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
janjurca committed Mar 3, 2025
1 parent 1d2b513 commit 52bec0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/scenarios/aging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ void AgingScenario::run() {

#elif __linux__ || __unix__ || defined(_POSIX_VERSION)
if (new_file_size > actual_file_size) { // Only expand, never shrink
if (fallocate(fd, 0, actual_file_size, new_file_size - actual_file_size) == -1) {
if (fallocate(fd, 0, actual_file_size, new_file_size.get_value() - actual_file_size) == -1) {
perror("fallocate");
throw std::runtime_error("fallocate failed for file: " + random_file_path);
}
Expand Down

0 comments on commit 52bec0b

Please sign in to comment.