From: Ritesh Harjani (IBM) Date: Thu, 15 May 2025 19:50:49 +0000 (+0530) Subject: ext4: Document an edge case for overwrites X-Git-Tag: v6.16-rc1~139^2~12 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=9fa6121684dad974c8c2b2aceb0df2b27f0627fe;p=linux-block.git ext4: Document an edge case for overwrites ext4_iomap_overwrite_begin() clears the flag for IOMAP_WRITE before calling ext4_iomap_begin(). Document this above ext4_map_blocks() call as it is easy to miss it when focusing on write paths alone. Reviewed-by: Ojaswin Mujoo Acked-by: Darrick J. Wong Signed-off-by: Ritesh Harjani (IBM) Link: https://patch.msgid.link/fd50ba05440042dff77d555e463a620a79f8d0e9.1747337952.git.ritesh.list@gmail.com Signed-off-by: Theodore Ts'o --- diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 6c56735df4cb..9f3b3db14eda 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3490,6 +3490,10 @@ static int ext4_iomap_begin(struct inode *inode, loff_t offset, loff_t length, } ret = ext4_iomap_alloc(inode, &map, flags); } else { + /* + * This can be called for overwrites path from + * ext4_iomap_overwrite_begin(). + */ ret = ext4_map_blocks(NULL, inode, &map, 0); }