Skip to content

Commit

Permalink
Fix file size expansion logic in fallocate call to use get_value()
Browse files Browse the repository at this point in the history
  • Loading branch information
janjurca committed Mar 3, 2025
1 parent 52bec0b commit 409dddc
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 @@ -364,7 +364,7 @@ void AgingScenario::run() {
throw std::runtime_error("FALLOCATE not supported on this system");

#elif __linux__ || __unix__ || defined(_POSIX_VERSION)
if (new_file_size > actual_file_size) { // Only expand, never shrink
if (new_file_size.get_value() > actual_file_size) { // Only expand, never shrink
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 409dddc

Please sign in to comment.