aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs/ext4/inode.c
diff options
context:
space:
mode:
authorZhang Yi <yi.zhang@huawei.com>2024-09-06 14:14:01 +0800
committerTheodore Ts'o <tytso@mit.edu>2024-11-12 23:54:14 -0500
commita90825898becb730377b157884c82a725f1d3ffa (patch)
treee300340dabbfadc6bb063c0673b82f1c8ccac43f /fs/ext4/inode.c
parentext4: mark ctx_*_flags() with __maybe_unused (diff)
downloadwireguard-linux-a90825898becb730377b157884c82a725f1d3ffa.tar.xz
wireguard-linux-a90825898becb730377b157884c82a725f1d3ffa.zip
ext4: don't pass full mapping flags to ext4_es_insert_extent()
When converting a delalloc extent in ext4_es_insert_extent(), since we only want to pass the info of whether the quota has already been claimed if the allocation is a direct allocation from ext4_map_create_blocks(), there is no need to pass full mapping flags, so changes to just pass whether the EXT4_GET_BLOCKS_DELALLOC_RESERVE bit is set. Suggested-by: Jan Kara <jack@suse.cz> Signed-off-by: Zhang Yi <yi.zhang@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://patch.msgid.link/20240906061401.2980330-1-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r--fs/ext4/inode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 5d20275526c3..9b06c9e0a7c5 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -483,7 +483,7 @@ static int ext4_map_query_blocks(handle_t *handle, struct inode *inode,
status = map->m_flags & EXT4_MAP_UNWRITTEN ?
EXTENT_STATUS_UNWRITTEN : EXTENT_STATUS_WRITTEN;
ext4_es_insert_extent(inode, map->m_lblk, map->m_len,
- map->m_pblk, status, 0);
+ map->m_pblk, status, false);
return retval;
}
@@ -563,8 +563,8 @@ static int ext4_map_create_blocks(handle_t *handle, struct inode *inode,
status = map->m_flags & EXT4_MAP_UNWRITTEN ?
EXTENT_STATUS_UNWRITTEN : EXTENT_STATUS_WRITTEN;
- ext4_es_insert_extent(inode, map->m_lblk, map->m_len,
- map->m_pblk, status, flags);
+ ext4_es_insert_extent(inode, map->m_lblk, map->m_len, map->m_pblk,
+ status, flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE);
return retval;
}