linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH v2] f2fs: fix to map blocks correctly for direct write
@ 2024-11-04  1:35 Chao Yu via Linux-f2fs-devel
  2024-11-18 17:00 ` patchwork-bot+f2fs--- via Linux-f2fs-devel
  0 siblings, 1 reply; 2+ messages in thread
From: Chao Yu via Linux-f2fs-devel @ 2024-11-04  1:35 UTC (permalink / raw)
  To: jaegeuk; +Cc: kernel test robot, linux-kernel, Cyril Hrubis, linux-f2fs-devel

f2fs_map_blocks() supports to map continuous holes or preallocated
address, we should avoid setting F2FS_MAP_MAPPED for these cases
only, otherwise, it may fail f2fs_iomap_begin(), and make direct
write fallbacking to use buffered IO and flush, result in performance
regression.

Fixes: 9f0f6bf42714 ("f2fs: support to map continuous holes or preallocated address")
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202409122103.e45aa13b-oliver.sang@intel.com
Cc: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Chao Yu <chao@kernel.org>
---
v2:
- fix wrong commit tile
- clean up code and comment suggested by Jaegeuk
 fs/f2fs/data.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 306b86b0595d..7d1bb9518a40 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1676,7 +1676,8 @@ int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map, int flag)
 		/* reserved delalloc block should be mapped for fiemap. */
 		if (blkaddr == NEW_ADDR)
 			map->m_flags |= F2FS_MAP_DELALLOC;
-		if (flag != F2FS_GET_BLOCK_DIO || !is_hole)
+		/* DIO READ and hole case, should not map the blocks. */
+		if (!(flag == F2FS_GET_BLOCK_DIO && is_hole && !map->m_may_create))
 			map->m_flags |= F2FS_MAP_MAPPED;
 
 		map->m_pblk = blkaddr;
-- 
2.40.1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [f2fs-dev] [PATCH v2] f2fs: fix to map blocks correctly for direct write
  2024-11-04  1:35 [f2fs-dev] [PATCH v2] f2fs: fix to map blocks correctly for direct write Chao Yu via Linux-f2fs-devel
@ 2024-11-18 17:00 ` patchwork-bot+f2fs--- via Linux-f2fs-devel
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+f2fs--- via Linux-f2fs-devel @ 2024-11-18 17:00 UTC (permalink / raw)
  To: Chao Yu; +Cc: jaegeuk, oliver.sang, linux-kernel, chrubis, linux-f2fs-devel

Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:

On Mon,  4 Nov 2024 09:35:51 +0800 you wrote:
> f2fs_map_blocks() supports to map continuous holes or preallocated
> address, we should avoid setting F2FS_MAP_MAPPED for these cases
> only, otherwise, it may fail f2fs_iomap_begin(), and make direct
> write fallbacking to use buffered IO and flush, result in performance
> regression.
> 
> Fixes: 9f0f6bf42714 ("f2fs: support to map continuous holes or preallocated address")
> Reported-by: kernel test robot <oliver.sang@intel.com>
> Closes: https://lore.kernel.org/oe-lkp/202409122103.e45aa13b-oliver.sang@intel.com
> Cc: Cyril Hrubis <chrubis@suse.cz>
> Signed-off-by: Chao Yu <chao@kernel.org>
> 
> [...]

Here is the summary with links:
  - [f2fs-dev,v2] f2fs: fix to map blocks correctly for direct write
    https://git.kernel.org/jaegeuk/f2fs/c/5dd00ebda337

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html




_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-18 17:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-04  1:35 [f2fs-dev] [PATCH v2] f2fs: fix to map blocks correctly for direct write Chao Yu via Linux-f2fs-devel
2024-11-18 17:00 ` patchwork-bot+f2fs--- via Linux-f2fs-devel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).