On 1/14/2026 4:37 PM, liujinbao1 wrote:
From: liujinbao1 <[email protected]>
During SPO tests, when mounting F2FS, an -EINVAL error was returned.
The issue originates from the f2fs_recover_inode_page function's
check, where old_ni.blk_addr != NULL_ADDR under the conditions of
IS_INODE(folio) && is_dent_dnode(folio).
Clear dent flag of the node block to fix this issue.
Test Step:
1.Modify files and induce SPO to generate fsync inode list.
blkaddr: 0x15828, ino: 1378, is_inode: 1, is_fsync: 2, is_dent: 0
2.Use inject.f2fs to set dent flag for a fsync inode.
inject.f2fs --cp 0 --mb flag --idx 2 --val 7 /dev/vda
Info: inject blkaddr[2] flag of cp 2: 0x3 -> 0x7
3.Boot verification, System fails to mount during recovery:
f2fs_recover_inode_page:ino: 1378, ni.blkaddr: 0x1581a,
old_ni.blk_addr != NULL_ADDR
F2FS-fs (vda): Cannot recover all fsync data errno=-22
4.Run fsck
fsck.f2fs -f /dev/vda
[ASSERT] (f2fs_find_fsync_inode:3924) --> Invalid dent flag:
blkaddr: 0x15828, ino: 1378, is_dent: 4, nat entry blkaddr: 0x1581a
[FIX] (f2fs_find_fsync_inode:3931) --> Clear dent flag: blkaddr: 0x15828,
ino: 1378
After this fix, the system boots normally.
Signed-off-by: Sheng Yong <[email protected]>
Signed-off-by: Yongpeng Yang <[email protected]>
Signed-off-by: Jinbao Liu <[email protected]>
Reviewed-by: Chao Yu <[email protected]>
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel