Message ID | 20241001164952.58114-6-massimiliano.pellizzer@canonical.com |
---|---|
State | New |
Headers | show |
Series | [SRU,N,1/1] 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 8015d3fbc7dd..b6ec4d25920f 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -1560,6 +1560,16 @@ 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); + 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; + } + err = f2fs_gc_pinned_control(inode, gc_type, segno); if (err == -EAGAIN) { iput(inode);