From: Chao Yu <chao@kernel.org>
To: Roman Smirnov <r.smirnov@omp.ru>, Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Sergey Shtylyov <s.shtylyov@omp.ru>,
Karina Yankevich <k.yankevich@omp.ru>,
linux-f2fs-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org
Subject: Re: [PATCH] f2fs: Cast expression type to unsigned long in __count_extent_cache()
Date: Wed, 6 Mar 2024 09:48:38 +0800 [thread overview]
Message-ID: <3017291c-f600-4810-8d6e-8d9ef7a8d43f@kernel.org> (raw)
In-Reply-To: <20240305080943.6922-1-r.smirnov@omp.ru>
On 2024/3/5 16:09, Roman Smirnov wrote:
> Cast expression type to unsigned long in __count_extent_cache()
> to prevent integer overflow.
>
> Found by Linux Verification Center (linuxtesting.org) with Svace.
>
> Signed-off-by: Roman Smirnov <r.smirnov@omp.ru>
> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
> ---
> fs/f2fs/shrinker.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/shrinker.c b/fs/f2fs/shrinker.c
> index 83d6fb97dcae..bb86a06c5d5e 100644
> --- a/fs/f2fs/shrinker.c
> +++ b/fs/f2fs/shrinker.c
> @@ -33,7 +33,7 @@ static unsigned long __count_extent_cache(struct f2fs_sb_info *sbi,
> {
> struct extent_tree_info *eti = &sbi->extent_tree[type];
>
> - return atomic_read(&eti->total_zombie_tree) +
> + return (unsigned long)atomic_read(&eti->total_zombie_tree) +
> atomic_read(&eti->total_ext_node);
> }
>
next prev parent reply other threads:[~2024-03-06 1:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-05 8:09 Roman Smirnov
2024-03-06 1:48 ` Chao Yu [this message]
2024-03-06 17:50 ` [f2fs-dev] " patchwork-bot+f2fs
2024-03-10 17:46 ` David Laight
2024-03-11 20:37 ` Jaegeuk Kim
2024-03-11 21:19 ` David Laight
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=3017291c-f600-4810-8d6e-8d9ef7a8d43f@kernel.org \
--to=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=k.yankevich@omp.ru \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=r.smirnov@omp.ru \
--cc=s.shtylyov@omp.ru \
/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
all inboxes | Powered by JetHome®