[PATCH 25/30] ocfs2: check dinode orphaned slots in online filecheck
From: Joseph Qi
Date: Thu Nov 05 2026 - 04:57:12 EST
Wire both orphaned slot predicates into the filecheck validator. Each
predicate keeps its flag guard, so a stale slot field on an inode that
is not orphaned is still accepted.
Signed-off-by: Joseph Qi <joseph.qi@xxxxxxxxxxxxxxxxx>
---
fs/ocfs2/inode.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
index 0c515ba37ea0..db8cdf4d8627 100644
--- a/fs/ocfs2/inode.c
+++ b/fs/ocfs2/inode.c
@@ -2045,6 +2045,24 @@ static int ocfs2_filecheck_validate_inode_block(struct super_block *sb,
goto bail;
}
+ if (ocfs2_dinode_has_bad_orphaned_slot(sb, di)) {
+ mlog(ML_ERROR,
+ "Filecheck: invalid dinode #%llu: orphaned slot %u\n",
+ (unsigned long long)bh->b_blocknr,
+ le16_to_cpu(di->i_orphaned_slot));
+ rc = -OCFS2_FILECHECK_ERR_INVALIDINO;
+ goto bail;
+ }
+
+ if (ocfs2_dinode_has_bad_dio_orphaned_slot(sb, di)) {
+ mlog(ML_ERROR,
+ "Filecheck: invalid dinode #%llu: DIO orphaned slot %u\n",
+ (unsigned long long)bh->b_blocknr,
+ le16_to_cpu(di->i_dio_orphaned_slot));
+ rc = -OCFS2_FILECHECK_ERR_INVALIDINO;
+ goto bail;
+ }
+
if (!ocfs2_valid_inode_mode(le16_to_cpu(di->i_mode))) {
mlog(ML_ERROR,
"Filecheck: invalid dinode #%llu: mode 0%o has unknown file type\n",
--
2.39.3