From: Baokun Li <libaokun@linux.alibaba.com>
To: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Cc: Dan Carpenter <dan.carpenter@linaro.org>,
"Ritesh Harjani (IBM)" <ritesh.list@gmail.com>,
linux-ext4@vger.kernel.org, Theodore Ts'o <tytso@mit.edu>
Subject: Re: [PATCH v2] ext4: Minor fix for ext4_split_extent_zeroout()
Date: Tue, 3 Mar 2026 09:55:48 +0800 [thread overview]
Message-ID: <765b1b39-3043-4a24-ba74-5e018071455e@linux.alibaba.com> (raw)
In-Reply-To: <20260302143811.605174-1-ojaswin@linux.ibm.com>
On 3/2/26 10:38 PM, Ojaswin Mujoo wrote:
> 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().
>
> Link: https://lore.kernel.org/all/aYXvVgPnKltX79KE@stanley.mountain/
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Fixes: a985e07c26455 ("ext4: refactor zeroout path and handle all cases")
> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
> Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Looks good to me.
Reviewed-by: Baokun Li <libaokun@linux.alibaba.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;
>
next prev parent reply other threads:[~2026-03-03 1:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-02 14:38 [PATCH v2] ext4: Minor fix for ext4_split_extent_zeroout() Ojaswin Mujoo
2026-03-02 19:43 ` Andreas Dilger
2026-03-03 1:55 ` Baokun Li [this message]
2026-03-07 8:18 ` Zhang Yi
2026-03-27 4:06 ` Theodore Ts'o
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=765b1b39-3043-4a24-ba74-5e018071455e@linux.alibaba.com \
--to=libaokun@linux.alibaba.com \
--cc=dan.carpenter@linaro.org \
--cc=linux-ext4@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=ritesh.list@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox