diff --git a/src/core/file_format/psf.cpp b/src/core/file_format/psf.cpp index 1df5d430e..a5e502f98 100644 --- a/src/core/file_format/psf.cpp +++ b/src/core/file_format/psf.cpp @@ -102,7 +102,12 @@ bool PSF::Encode(const std::filesystem::path& filepath) const { last_write = std::filesystem::file_time_type::clock::now(); const auto psf_buffer = Encode(); - return file.Write(psf_buffer) == psf_buffer.size(); + const size_t written = file.Write(psf_buffer); + if (written != psf_buffer.size()) { + LOG_ERROR(Core, "Failed to write PSF file. Written {} Expected {}", written, + psf_buffer.size()); + } + return written == psf_buffer.size(); } std::vector PSF::Encode() const { diff --git a/src/core/libraries/save_data/save_backup.cpp b/src/core/libraries/save_data/save_backup.cpp index 8f7e0d69a..d8281fab9 100644 --- a/src/core/libraries/save_data/save_backup.cpp +++ b/src/core/libraries/save_data/save_backup.cpp @@ -119,7 +119,7 @@ static void BackupThreadBody() { std::scoped_lock lk{g_backup_queue_mutex}; g_backup_queue.front().done = true; } - std::this_thread::sleep_for(std::chrono::seconds(10)); // Don't backup too often + std::this_thread::sleep_for(std::chrono::seconds(5)); // Don't backup too often { std::scoped_lock lk{g_backup_queue_mutex}; g_backup_queue.pop_front(); diff --git a/src/core/libraries/save_data/savedata.cpp b/src/core/libraries/save_data/savedata.cpp index d62c1b9a1..9599c1ffd 100644 --- a/src/core/libraries/save_data/savedata.cpp +++ b/src/core/libraries/save_data/savedata.cpp @@ -485,14 +485,14 @@ static Error Umount(const OrbisSaveDataMountPoint* mountPoint, bool call_backup if (instance.has_value()) { const auto& slot_name = instance->GetMountPoint(); if (slot_name == mount_point_str) { + // TODO: check if is busy + instance->Umount(); if (call_backup) { Backup::StartThread(); Backup::NewRequest(instance->GetUserId(), instance->GetTitleId(), instance->GetDirName(), OrbisSaveDataEventType::UMOUNT_BACKUP); } - // TODO: check if is busy - instance->Umount(); instance.reset(); return Error::OK; } @@ -581,10 +581,10 @@ Error PS4_SYSV_ABI sceSaveDataCheckBackupData(const OrbisSaveDataCheckBackupData LOG_INFO(Lib_SaveData, "called with invalid parameter"); return Error::PARAMETER; } - LOG_DEBUG(Lib_SaveData, "called with titleId={}", check->titleId->data.to_view()); const std::string_view title{check->titleId != nullptr ? std::string_view{check->titleId->data} : std::string_view{g_game_serial}}; + LOG_DEBUG(Lib_SaveData, "called with titleId={}", title); const auto save_path = SaveInstance::MakeDirSavePath(check->userId, title, check->dirName->data);