Re: [PATCH v2] f2fs: don't leave the hashed inode while it's unlinked
From: Jaegeuk Kim
Date: Mon Aug 24 2026 - 11:20:46 EST
Hi Wenjie,
Yeah, valid points. Let me send v3.
On 08/23, Wenjie Qi wrote:
> Hi Jaegeuk,
>
> It looks like the original symlink construction error is lost here:
>
> err = __do_unlink(dir, inode, &dentry->d_name);
>
> If fscrypt_encrypt_symlink() or page_symlink() fails but __do_unlink()
> succeeds, err becomes zero. f2fs_handle_failed_inode() then releases the
> inode, and f2fs_symlink() returns success even though the directory entry
> has been removed.
>
> Is this intended? Should the rollback result be stored separately, for
> example in ret, while preserving the original construction error in err?
>
> There seems to be a similar issue in the give_up path. If rollback fails
> in a DIRSYNC directory, a successful f2fs_sync_fs() can overwrite the
> existing error with zero.
>
> Regards,
> Wenjie