Check extra_attr feature for inode. If it is corrupted, remove the inode. Link: https://bugzilla.kernel.org/show_bug.cgi?id=200219 Reported-by: Wen Xu <wen...@gatech.edu> Signed-off-by: Sheng Yong <shengyo...@huawei.com> --- fsck/fsck.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/fsck/fsck.c b/fsck/fsck.c index 15264b2..acbe25d 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -460,6 +460,12 @@ static int sanity_check_nid(struct f2fs_sb_info *sbi, u32 nid, __check_inode_mode(nid, ftype, le32_to_cpu(node_blk->i.i_mode))) return -EINVAL; + if (ntype == TYPE_INODE && + ((f2fs_has_extra_isize(&node_blk->i) && + !(c.feature & F2FS_FEATURE_EXTRA_ATTR)) || + get_extra_isize(node_blk) >= DEF_ADDRS_PER_INODE)) + return -EINVAL; + /* workaround to fix later */ if (ftype != F2FS_FT_ORPHAN || f2fs_test_bit(nid, fsck->nat_area_bitmap) != 0) { -- 2.17.1 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel