Skip to content

Commit 797ac3c

Browse files
riteshharjanitytso
authored andcommitted
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: 5bb12b1 ("ext4: Add support for EXT4_GET_BLOCKS_QUERY_LEAF_BLOCKS") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202505191524.auftmOwK-lkp@intel.com/ Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com> Link: https://patch.msgid.link/5fd5c806218c83f603c578c95997cf7f6da29d74.1747677758.git.ritesh.list@gmail.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent 3be4bb7 commit 797ac3c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/ext4/inode.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,7 @@ static int ext4_map_query_blocks(handle_t *handle, struct inode *inode,
570570
* - if the last in leaf is the full requested range
571571
*/
572572
if (!(map->m_flags & EXT4_MAP_QUERY_LAST_IN_LEAF) ||
573-
((map->m_flags & EXT4_MAP_QUERY_LAST_IN_LEAF) &&
574-
(map->m_len == orig_mlen))) {
573+
map->m_len == orig_mlen) {
575574
status = map->m_flags & EXT4_MAP_UNWRITTEN ?
576575
EXTENT_STATUS_UNWRITTEN : EXTENT_STATUS_WRITTEN;
577576
ext4_es_insert_extent(inode, map->m_lblk, map->m_len,

0 commit comments

Comments
 (0)