f2fs: zone: fix to don't trigger OPU on pinfile for direct IO
authorChao Yu <chao@kernel.org>
Sun, 28 Apr 2024 01:12:36 +0000 (09:12 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 29 Apr 2024 17:41:17 +0000 (17:41 +0000)
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>
fs/f2fs/data.c

index 0c516c653f0507afc6bda5b2b7362206294fb99c..a990236f137ea4c389fd72d2e5d49ff87fab10da 100644 (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;