Re: [f2fs-dev] [PATCH] f2fs: return -EIO for a lost inode block after cp_error

From: Chao Yu

Date: Wed Oct 14 2026 - 05:26:48 EST


On 10/13/26 02:22, Daeho Jeong wrote:
> From: Daeho Jeong <daehojeong@xxxxxxxxxx>
>
> After cp_error, dirty node caches are dropped without being written.
> If such an inode was never written, its NAT entry is still NEW_ADDR,
> and reading its inode block returns -ENOENT.
>
> f2fs_get_dnode_of_data() passes that -ENOENT up, and callers take it
> as a hole. Since the inode block is missing, the next offset can only
> advance one block, so fiemap walks block by block up to maxbytes,
> about 2^30 blocks, while holding the inode lock. It took hours in a
> power-off recovery test after shutdown and blocked unlink and umount
> on the file.
>
> Return -EIO instead of -ENOENT when the inode block itself is missing
> after cp_error or shutdown. A missing direct or indirect node is still
> reported as -ENOENT.
>

Cc: stable@xxxxxxxxxx
Fixes: 28607bf3aa6f ("f2fs: drop dirty node pages when cp is in error status")

> Signed-off-by: Daeho Jeong <daehojeong@xxxxxxxxxx>
Reviewed-by: Chao Yu <chao@xxxxxxxxxx>

Thanks,