Message ID | 20241001164952.58114-3-massimiliano.pellizzer@canonical.com |
---|---|
State | New |
Headers | show |
Series | CVE-2024-44942 | expand |
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index d26b3fe38bd9..96dc497636c1 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -1073,6 +1073,16 @@ static int gc_data_segment(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, special_file(inode->i_mode)) continue; + if (f2fs_has_inline_data(inode)) { + iput(inode); + set_sbi_flag(sbi, SBI_NEED_FSCK); + f2fs_err_ratelimited(sbi, + "inode %lx has both inline_data flag and " + "data block, nid=%u, ofs_in_node=%u", + inode->i_ino, dni.nid, ofs_in_node); + continue; + } + if (!down_write_trylock( &F2FS_I(inode)->i_gc_rwsem[WRITE])) { iput(inode);