From: "Liam R. Howlett" <Liam.Howlett@oracle.com>
To: Petr Tesarik <ptesarik@suse.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"open list:MAPLE TREE" <maple-tree@lists.infradead.org>,
"open list:MAPLE TREE" <linux-mm@kvack.org>,
"open list:LIBRARY CODE" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] maple_tree: Remove a BUG_ON() in mas_alloc_nodes()
Date: Thu, 13 Feb 2025 14:37:28 -0500 [thread overview]
Message-ID: <2asqgre2rmhe57zo2w446s5ohk2psqmvqkpthyfujoc3klylqf@wcayx3xqnzqk> (raw)
In-Reply-To: <20250213114453.1078318-1-ptesarik@suse.com>
* Petr Tesarik <ptesarik@suse.com> [250213 06:45]:
> Remove a BUG_ON() right before a WARN_ON() with the same condition.
>
> Calling WARN_ON() and BUG_ON() here is definitely wrong. Since the goal is
> generally to remove BUG_ON() invocations from the kernel, keep only the
> WARN_ON().
Sure.. but this isn't going to have the end result of not crashing. We
ran out of allocations so we will very quickly be dereferencing NULL.
Care has been taken to avoid this from happening, so I'm fine with
either as this comes up in testing only. In fact, I probably added this
during the testing and it slipped through. Thanks for finding it.
>
> Fixes: 067311d33e65 ("maple_tree: separate ma_state node from status")
> Signed-off-by: Petr Tesarik <ptesarik@suse.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
> ---
> lib/maple_tree.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/lib/maple_tree.c b/lib/maple_tree.c
> index f7153ade1be5..0f2111d436c4 100644
> --- a/lib/maple_tree.c
> +++ b/lib/maple_tree.c
> @@ -1245,7 +1245,6 @@ static inline void mas_alloc_nodes(struct ma_state *mas, gfp_t gfp)
> if (mas->mas_flags & MA_STATE_PREALLOC) {
> if (allocated)
> return;
> - BUG_ON(!allocated);
> WARN_ON(!allocated);
> }
>
> --
> 2.48.1
>
prev parent reply other threads:[~2025-02-13 19:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 11:44 Petr Tesarik
2025-02-13 19:37 ` Liam R. Howlett [this message]
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=2asqgre2rmhe57zo2w446s5ohk2psqmvqkpthyfujoc3klylqf@wcayx3xqnzqk \
--to=liam.howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=maple-tree@lists.infradead.org \
--cc=ptesarik@suse.com \
/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