Skip to contentSkip to conversation

fsck.f2fs: drop compression bit if inline_data is set

PATCH In review Jaegeuk Kim 2 participants 2 messages Jun 21, 2022 – Jul 3, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fsck.f2fs: drop compression bit if inline_data is set

The kernel enforced not to have compression and inline_data bits together, but old kernel created files with them. Let's disable compression in that case.

---
 fsck/fsck.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
fsck/fsck.c +5 -1
index 4b546aeff995..b1b6722566ef 100644
@@ -712,7 +712,10 @@ void fsck_chk_inode_blk(struct f2fs_sb_info *sbi, u32 nid,
 	int ret;
 	u32 cluster_size = 1 << node_blk->i.i_log_cluster_size;
 
-	if (!compr_supported && compressed) {
+	if (!compressed)
+		goto check_next;
+
+	if (!compr_supported || (node_blk->i.i_inline & F2FS_INLINE_DATA)) {
 		/*
 		 * The 'compression' flag in i_flags affects the traverse of
 		 * the node tree.  Thus, it must be fixed unconditionally
@@ -727,6 +730,7 @@ void fsck_chk_inode_blk(struct f2fs_sb_info *sbi, u32 nid,
 		}
 		i_flags &= ~F2FS_COMPR_FL;
 	}
+check_next:
 	memset(&child, 0, sizeof(child));
 	child.links = 2;
 	child.p_ino = nid;
Signature · 8 lines
2.37.0.rc0.104.g0611611a94-goog



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