[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aCyTbk-FYrkuBvxM@li-dc0c254c-257c-11b2-a85c-98b6c1322444.ibm.com>
Date: Tue, 20 May 2025 20:06:30 +0530
From: Ojaswin Mujoo <ojaswin@...ux.ibm.com>
To: "Ritesh Harjani (IBM)" <ritesh.list@...il.com>
Cc: linux-ext4@...r.kernel.org, "Theodore Ts'o" <tytso@....edu>,
Jan Kara <jack@...e.cz>, John Garry <john.g.garry@...cle.com>,
djwong@...nel.org, linux-fsdevel@...r.kernel.org,
kernel test robot <lkp@...el.com>
Subject: Re: [PATCH v1 2/5] ext4: Simplify last in leaf check in
ext4_map_query_blocks
On Mon, May 19, 2025 at 11:49:27PM +0530, Ritesh Harjani (IBM) wrote:
> 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: 2e7bad830aa9 ("ext4: Add support for EXT4_GET_BLOCKS_QUERY_LEAF_BLOCKS")
> Reported-by: kernel test robot <lkp@...el.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202505191524.auftmOwK-lkp@intel.com/
> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@...il.com>
Makes sense, feel free to add:
Reviewed-by: Ojaswin Mujoo <ojaswin@...ux.ibm.com>
> ---
> fs/ext4/inode.c | 3 +--
> 1 file changed, 1 insertion(+), 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,
> --
> 2.49.0
>
Powered by blists - more mailing lists