Skip to content

Commit 9fa6121

Browse files
riteshharjanitytso
authored andcommitted
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 <ojaswin@linux.ibm.com> Acked-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Link: https://patch.msgid.link/fd50ba05440042dff77d555e463a620a79f8d0e9.1747337952.git.ritesh.list@gmail.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent fff6f35 commit 9fa6121

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

fs/ext4/inode.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3490,6 +3490,10 @@ static int ext4_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
34903490
}
34913491
ret = ext4_iomap_alloc(inode, &map, flags);
34923492
} else {
3493+
/*
3494+
* This can be called for overwrites path from
3495+
* ext4_iomap_overwrite_begin().
3496+
*/
34933497
ret = ext4_map_blocks(NULL, inode, &map, 0);
34943498
}
34953499

0 commit comments

Comments
 (0)