f2fs: zone: fix to don't trigger OPU on pinfile for direct IO

Otherwise, it breaks pinfile's sematics.

Cc: Daeho Jeong <daeho43@gmail.com>
Signed-off-by: Chao Yu <chao@kernel.org>
Reviewed-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Chao Yu 2024-04-28 09:12:36 +08:00 committed by Jaegeuk Kim
parent 20faaf30e5
commit 48d180e2bf

View File

@ -1595,8 +1595,9 @@ next_block:
}
/* use out-place-update for direct IO under LFS mode */
if (map->m_may_create &&
(is_hole || (f2fs_lfs_mode(sbi) && flag == F2FS_GET_BLOCK_DIO))) {
if (map->m_may_create && (is_hole ||
(flag == F2FS_GET_BLOCK_DIO && f2fs_lfs_mode(sbi) &&
!f2fs_is_pinned_file(inode)))) {
if (unlikely(f2fs_cp_error(sbi))) {
err = -EIO;
goto sync_out;