Skip to content

Commit

Permalink
util: Fix segfault when doing a backup with an empty backup_path
Browse files Browse the repository at this point in the history
Revert change of 'util: Fix occurances where back() might be called on an
empty string' for `zenfs_tool_backup()`.

Otherwise test/utils/0040_backup.sh segfaults when building ZenFS with
RocksDB 6.29.fb (c++11).

Signed-off-by: Dennis Maisenbacher <dennis.maisenbacher@wdc.com>
Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
  • Loading branch information
MaisenbacherD authored and yhr committed Oct 24, 2023
1 parent 7ce4100 commit 8337de1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/zenfs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ int zenfs_tool_backup() {
}

std::string backup_path = FLAGS_backup_path;
AddDirSeparatorAtEnd(backup_path);
if (backup_path.size() > 0 && backup_path.back() != '/') backup_path += "/";
io_status = zenfs_tool_copy_dir(zenFS.get(), backup_path,
FileSystem::Default().get(), FLAGS_path);
}
Expand Down

0 comments on commit 8337de1

Please sign in to comment.