diff options
| author | Ritesh Harjani (IBM) <[email protected]> | 2025-05-19 18:19:27 +0000 |
|---|---|---|
| committer | Theodore Ts'o <[email protected]> | 2025-05-20 18:21:00 +0000 |
| commit | 797ac3ca24ca1af396e84d16c79c523cfefe1737 (patch) | |
| tree | 285c8a0c87e839279409e0c1811254eedb2a6dc5 | |
| parent | ext4: Unwritten to written conversion requires EXT4_EX_NOCACHE (diff) | |
| download | kernel-797ac3ca24ca1af396e84d16c79c523cfefe1737.tar.gz kernel-797ac3ca24ca1af396e84d16c79c523cfefe1737.zip | |
ext4: Simplify last in leaf check in ext4_map_query_blocks
This simplifies the check for last in leaf in ext4_map_query_blocks()
and fixes this cocci warning.
cocci warnings: (new ones prefixed by >>)
>> fs/ext4/inode.c:573:49-51: WARNING !A || A && B is equivalent to !A || B
Fixes: 5bb12b1837c0 ("ext4: Add support for EXT4_GET_BLOCKS_QUERY_LEAF_BLOCKS")
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Signed-off-by: Ritesh Harjani (IBM) <[email protected]>
Reviewed-by: Ojaswin Mujoo <[email protected]>
Link: https://patch.msgid.link/5fd5c806218c83f603c578c95997cf7f6da29d74.1747677758.git.ritesh.list@gmail.com
Signed-off-by: Theodore Ts'o <[email protected]>
| -rw-r--r-- | fs/ext4/inode.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index ce0632094c50..459ffc6af1d3 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -570,8 +570,7 @@ static int ext4_map_query_blocks(handle_t *handle, struct inode *inode, * - if the last in leaf is the full requested range */ if (!(map->m_flags & EXT4_MAP_QUERY_LAST_IN_LEAF) || - ((map->m_flags & EXT4_MAP_QUERY_LAST_IN_LEAF) && - (map->m_len == orig_mlen))) { + map->m_len == orig_mlen) { status = map->m_flags & EXT4_MAP_UNWRITTEN ? EXTENT_STATUS_UNWRITTEN : EXTENT_STATUS_WRITTEN; ext4_es_insert_extent(inode, map->m_lblk, map->m_len, |
