Skip to content

RDKTV-35245 : handle file system corruption issue #6208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: release/xumo_ota10
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
RDKTV-35245 : handle file system corruption issue
Reason for change: file became a folder and cannot be removed.
Test Procedure: None
Risks: None

Signed-off-by: nanimatta <[email protected]>
  • Loading branch information
nanimatta committed Apr 21, 2025
commit 4e4114204dfbc01db30dd9db3554b37168bf195d
4 changes: 4 additions & 0 deletions PersistentStore/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ All notable changes to this RDK Service will be documented in this file.

* For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README.

## [2.0.2] - 2025-04-21
### Fixed
- Delete sqlite temporary data

## [2.0.1] - 2024-09-17
### Fixed
- Decouple notification, add timeouts
Expand Down
2 changes: 1 addition & 1 deletion PersistentStore/PersistentStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#define API_VERSION_NUMBER_MAJOR 2
#define API_VERSION_NUMBER_MINOR 0
#define API_VERSION_NUMBER_PATCH 1
#define API_VERSION_NUMBER_PATCH 2

namespace WPEFramework {

Expand Down
16 changes: 16 additions & 0 deletions PersistentStore/sqlite/Store2.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ namespace Plugin {
, _maxValue(maxValue)
, _limit(limit)
{
TempDirectoryCheck();
Open();
}
~Store2() override
Expand All @@ -96,6 +97,21 @@ namespace Plugin {
}

private:
void TempDirectoryCheck()
{
Core::File file(_path + "-journal");
if (file.IsDirectory()) { // It's supposed to be a file
TRACE(Trace::Error, (_T("file system corruption")));
if (!file.Move(file.Name() + "-old")) {
perror("rename failed");
}
Core::Directory(file.Name().c_str()).Destroy();
if (!file.Destroy()) {
perror("remove failed");

}
}
}
void Open()
{
Core::File file(_path);
Expand Down
Loading