Patch "f2fs: fix to map blocks correctly for direct write" has been added to the 6.12-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    f2fs: fix to map blocks correctly for direct write

to the 6.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     f2fs-fix-to-map-blocks-correctly-for-direct-write.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 5dec58105496ef09d7a4764c53eab58b97c858d4
Author: Chao Yu <chao@xxxxxxxxxx>
Date:   Mon Nov 4 09:35:51 2024 +0800

    f2fs: fix to map blocks correctly for direct write
    
    [ Upstream commit 5dd00ebda337b9295e7027691fa70540da369ff2 ]
    
    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@xxxxxxxxx>
    Closes: https://lore.kernel.org/oe-lkp/202409122103.e45aa13b-oliver.sang@xxxxxxxxx
    Cc: Cyril Hrubis <chrubis@xxxxxxx>
    Signed-off-by: Chao Yu <chao@xxxxxxxxxx>
    Signed-off-by: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 9202082a3902c..3439f72052ee8 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;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux