All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
To: Ojaswin Mujoo <ojaswin@linux.ibm.com>,
	linux-ext4@vger.kernel.org, Theodore Ts'o <tytso@mit.edu>
Cc: Dan Carpenter <dan.carpenter@linaro.org>
Subject: Re: [PATCH] ext4: Minor fix for ext4_split_extent_zeroout()
Date: Tue, 17 Feb 2026 11:03:53 +0530	[thread overview]
Message-ID: <87tsvg7x32.ritesh.list@gmail.com> (raw)
In-Reply-To: <20260206155821.2869356-1-ojaswin@linux.ibm.com>

Ojaswin Mujoo <ojaswin@linux.ibm.com> writes:

> We missed storing the error which triggerd smatch warning:
>
> 	fs/ext4/extents.c:3369 ext4_split_extent_zeroout()
> 	warn: duplicate zero check 'err' (previous on line 3363)
>
> fs/ext4/extents.c
>     3361
>     3362         err = ext4_ext_get_access(handle, inode, path + depth);
>     3363         if (err)
>     3364                 return err;
>     3365
>     3366         ext4_ext_mark_initialized(ex);
>     3367
>     3368         ext4_ext_dirty(handle, inode, path + depth);
> --> 3369         if (err)
>     3370                 return err;
>     3371
>     3372         return 0;
>     3373 }
>
> Fix it by correctly storing the err value from ext4_ext_dirty().
>


Looks straight forward.


> Link: https://lore.kernel.org/all/aYXvVgPnKltX79KE@stanley.mountain/
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>

Fixes: a985e07c26455 ("ext4: refactor zeroout path and handle all cases")

Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>


> ---
>  fs/ext4/extents.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index 3630b27e4fd7..5579e0e68c0f 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -3365,7 +3365,7 @@ static int ext4_split_extent_zeroout(handle_t *handle, struct inode *inode,
>  
>  	ext4_ext_mark_initialized(ex);
>  
> -	ext4_ext_dirty(handle, inode, path + depth);
> +	err = ext4_ext_dirty(handle, inode, path + depth);
>  	if (err)
>  		return err;
>  
> -- 
> 2.52.0

  reply	other threads:[~2026-02-17  5:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-06 15:58 [PATCH] ext4: Minor fix for ext4_split_extent_zeroout() Ojaswin Mujoo
2026-02-17  5:33 ` Ritesh Harjani [this message]
2026-03-02 14:30   ` Ojaswin Mujoo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tsvg7x32.ritesh.list@gmail.com \
    --to=ritesh.list@gmail.com \
    --cc=dan.carpenter@linaro.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=ojaswin@linux.ibm.com \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.