From 48d180e2bf5a527ba6513a8abddf8b3beb6b7674 Mon Sep 17 00:00:00 2001 From: Chao Yu Date: Sun, 28 Apr 2024 09:12:36 +0800 Subject: f2fs: zone: fix to don't trigger OPU on pinfile for direct IO Otherwise, it breaks pinfile's sematics. Cc: Daeho Jeong Signed-off-by: Chao Yu Reviewed-by: Daeho Jeong Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fs/f2fs/data.c') diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 0c516c653f05..a990236f137e 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -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; -- cgit v1.2.3