aboutsummaryrefslogtreecommitdiff
path: root/ubifs-utils/fsck.ubifs/problem.c
diff options
context:
space:
mode:
authorZhihao Cheng <chengzhihao1@huawei.com>2024-11-11 17:08:15 +0800
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2024-11-11 10:32:46 +0100
commit2400ee616991542f39a154fe8c3cafe8ef940003 (patch)
tree5c098dbf863076b00f9b80b7afee0d6716794fc6 /ubifs-utils/fsck.ubifs/problem.c
parentfda7068da735d3e574bc46b70d3af62a5db8e908 (diff)
fsck.ubifs: Handle disconnected files
This is the 17/18 step of fsck. Recover disconnected files into lost+found. If there is no free space left to recover the disconnected files, fsck may delete the files to make filesystem be consistent. Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'ubifs-utils/fsck.ubifs/problem.c')
-rw-r--r--ubifs-utils/fsck.ubifs/problem.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ubifs-utils/fsck.ubifs/problem.c b/ubifs-utils/fsck.ubifs/problem.c
index 8e7e1e1..916c976 100644
--- a/ubifs-utils/fsck.ubifs/problem.c
+++ b/ubifs-utils/fsck.ubifs/problem.c
@@ -69,6 +69,7 @@ static const struct fsck_problem problem_table[] = {
{PROBLEM_FIXABLE | PROBLEM_MUST_FIX, "Inconsistent properties for lprops table"}, // LTAB_INCORRECT
{PROBLEM_FIXABLE | PROBLEM_MUST_FIX, "Incorrect index size"}, // INCORRECT_IDX_SZ
{PROBLEM_FIXABLE | PROBLEM_MUST_FIX, "Root dir is lost"}, // ROOT_DIR_NOT_FOUND
+ {PROBLEM_FIXABLE | PROBLEM_DROP_DATA, "Disconnected file cannot be recovered"}, // DISCONNECTED_FILE_CANNOT_BE_RECOVERED
};
static const char *get_question(const struct fsck_problem *problem,
@@ -96,6 +97,7 @@ static const char *get_question(const struct fsck_problem *problem,
case FILE_HAS_NO_ENCRYPT:
case FILE_ROOT_HAS_DENT:
case DENTRY_IS_UNREACHABLE:
+ case DISCONNECTED_FILE_CANNOT_BE_RECOVERED:
return "Delete it?";
case FILE_HAS_INCONSIST_TYPE:
case FILE_HAS_TOO_MANY_DENT:
@@ -292,6 +294,14 @@ static void print_problem(const struct ubifs_info *c,
problem->desc, c->calc_idx_sz, *calc_sz);
break;
}
+ case DISCONNECTED_FILE_CANNOT_BE_RECOVERED:
+ {
+ const struct scanned_file *file = (const struct scanned_file *)priv;
+
+ log_out(c, "problem: %s, ino %lu, size %llu", problem->desc,
+ file->inum, file->ino.size);
+ break;
+ }
default:
log_out(c, "problem: %s", problem->desc);
break;