Skip to content

Commit 48d180e

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: zone: fix to don't trigger OPU on pinfile for direct IO
Otherwise, it breaks pinfile's sematics. Cc: Daeho Jeong <[email protected]> Signed-off-by: Chao Yu <[email protected]> Reviewed-by: Daeho Jeong <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 20faaf3 commit 48d180e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/f2fs/data.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,8 +1595,9 @@ int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map, int flag)
15951595
}
15961596

15971597
/* use out-place-update for direct IO under LFS mode */
1598-
if (map->m_may_create &&
1599-
(is_hole || (f2fs_lfs_mode(sbi) && flag == F2FS_GET_BLOCK_DIO))) {
1598+
if (map->m_may_create && (is_hole ||
1599+
(flag == F2FS_GET_BLOCK_DIO && f2fs_lfs_mode(sbi) &&
1600+
!f2fs_is_pinned_file(inode)))) {
16001601
if (unlikely(f2fs_cp_error(sbi))) {
16011602
err = -EIO;
16021603
goto sync_out;

0 commit comments

Comments
 (0)