Skip to content
/ linux Public

Commit afe9084

Browse files
OjaswinMSasha Levin
authored andcommitted
ext4: propagate flags to convert_initialized_extent()
[ Upstream commit 3fffa44 ] Currently, ext4_zero_range passes EXT4_EX_NOCACHE flag to avoid caching extents however this is not respected by convert_initialized_extent(). Hence, modify it to accept flags from the caller and to pass the flags on to other extent manipulation functions it calls. This makes sure the NOCACHE flag is respected throughout the code path. Also, we no longer explicitly pass CONVERT_UNWRITTEN as the caller takes care of this. Reviewed-by: Zhang Yi <yi.zhang@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com> Link: https://patch.msgid.link/07008fbb14db727fddcaf4c30e2346c49f6c8fe0.1769149131.git.ojaswin@linux.ibm.com Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 899ef00 commit afe9084

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fs/ext4/extents.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3853,6 +3853,7 @@ static struct ext4_ext_path *
38533853
convert_initialized_extent(handle_t *handle, struct inode *inode,
38543854
struct ext4_map_blocks *map,
38553855
struct ext4_ext_path *path,
3856+
int flags,
38563857
unsigned int *allocated)
38573858
{
38583859
struct ext4_extent *ex;
@@ -3878,11 +3879,11 @@ convert_initialized_extent(handle_t *handle, struct inode *inode,
38783879

38793880
if (ee_block != map->m_lblk || ee_len > map->m_len) {
38803881
path = ext4_split_convert_extents(handle, inode, map, path,
3881-
EXT4_GET_BLOCKS_CONVERT_UNWRITTEN, NULL);
3882+
flags, NULL);
38823883
if (IS_ERR(path))
38833884
return path;
38843885

3885-
path = ext4_find_extent(inode, map->m_lblk, path, 0);
3886+
path = ext4_find_extent(inode, map->m_lblk, path, flags);
38863887
if (IS_ERR(path))
38873888
return path;
38883889
depth = ext_depth(inode);
@@ -4294,7 +4295,7 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
42944295
if ((!ext4_ext_is_unwritten(ex)) &&
42954296
(flags & EXT4_GET_BLOCKS_CONVERT_UNWRITTEN)) {
42964297
path = convert_initialized_extent(handle,
4297-
inode, map, path, &allocated);
4298+
inode, map, path, flags, &allocated);
42984299
if (IS_ERR(path))
42994300
err = PTR_ERR(path);
43004301
goto out;

0 commit comments

Comments
 (0)