Message ID | 20241231115735.1308127-1-kovalev@altlinux.org (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [f2fs-dev,5.10.y] f2fs: fix to do sanity check on F2FS_INLINE_DATA flag in inode during GC | expand |
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 19d781a3d305a6..64ff51c2f3d642 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -1457,6 +1457,17 @@ static int gc_data_segment(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, continue; } + if (f2fs_has_inline_data(inode)) { + iput(inode); + set_sbi_flag(sbi, SBI_NEED_FSCK); + printk_ratelimited("%sF2FS-fs (%s): " + "inode %lx has both inline_data flag and " + "data block, nid=%u, ofs_in_node=%u", + KERN_INFO, sbi->sb->s_id, + inode->i_ino, dni.nid, ofs_in_node); + continue; + } + if (!down_write_trylock( &F2FS_I(inode)->i_gc_rwsem[WRITE])) { iput(inode);