fsck.f2fs: check only max extra_isize
authorJaegeuk Kim <jaegeuk@kernel.org>
Sat, 17 Aug 2019 01:02:28 +0000 (18:02 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 20 Aug 2019 18:23:51 +0000 (11:23 -0700)
If we use later kernel having larger extra_isize, old fsck will delete
entire old files.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fsck/fsck.c

index 6f0f262..e2104dd 100644 (file)
@@ -731,7 +731,7 @@ void fsck_chk_inode_blk(struct f2fs_sb_info *sbi, u32 nid,
        if (f2fs_has_extra_isize(&node_blk->i)) {
                if (c.feature & cpu_to_le32(F2FS_FEATURE_EXTRA_ATTR)) {
                        if (node_blk->i.i_extra_isize >
-                               cpu_to_le16(F2FS_TOTAL_EXTRA_ATTR_SIZE)) {
+                                               4 * DEF_ADDRS_PER_INODE) {
                                FIX_MSG("ino[0x%x] recover i_extra_isize "
                                        "from %u to %u",
                                        nid,