The kernel can record ERROR_INCONSISTENT_ORPHAN in the superblock
s_errors[] field when orphan inode metadata is inconsistent.

Add the matching f2fs_error entry and fsck error string so fsck.f2fs
can recognize and print this persistent corruption hint.

Signed-off-by: Wenjie Qi <[email protected]>
---
 fsck/mount.c      | 1 +
 include/f2fs_fs.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/fsck/mount.c b/fsck/mount.c
index 2f4e6c9..f7985dc 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -774,6 +774,7 @@ static char *errors_str[] = {
        [ERROR_CORRUPTED_XATTR]                 = "corrupted_xattr",
        [ERROR_INVALID_NODE_REFERENCE]          = "invalid_node_reference",
        [ERROR_INCONSISTENT_NAT]                = "inconsistent_nat",
+       [ERROR_INCONSISTENT_ORPHAN]             = "inconsistent_orphan",
 };
 
 void print_sb_errors(struct f2fs_super_block *sb)
diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
index 21310fa..1b24a3c 100644
--- a/include/f2fs_fs.h
+++ b/include/f2fs_fs.h
@@ -772,6 +772,7 @@ enum f2fs_error {
        ERROR_CORRUPTED_XATTR,
        ERROR_INVALID_NODE_REFERENCE,
        ERROR_INCONSISTENT_NAT,
+       ERROR_INCONSISTENT_ORPHAN,
        ERROR_MAX,
 };
 
-- 
2.43.0



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to