diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2022-06-21 13:02:54 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2022-07-05 18:02:29 -0700 |
commit | a74143858542ac733de92479f1f3d8a5984c1340 (patch) | |
tree | 603200a48d6434bff751c6aa149dc5e2edbb4e23 | |
parent | 406b1c930fbb24031490e04a54f97807532e5184 (diff) | |
download | f2fs-tools-a74143858542ac733de92479f1f3d8a5984c1340.tar.gz |
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.
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r-- | fsck/fsck.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fsck/fsck.c b/fsck/fsck.c index 4b546ae..b1b6722 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -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; |