All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged mm-stable] mm-vmalloc-replace-bug_on-to-a-simple-if-statement.patch removed from -mm tree
@ 2023-02-10  0:54 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2023-02-10  0:54 UTC (permalink / raw)
  To: mm-commits, urezki, sangyun.kim, rppt, gwan-gyeong.mun,
	christophe.leroy, casionwoo, 42.hyeyoo, hn.min.lee, akpm


The quilt patch titled
     Subject: mm/vmalloc: replace BUG_ON with a simple if statement
has been removed from the -mm tree.  Its filename was
     mm-vmalloc-replace-bug_on-to-a-simple-if-statement.patch

This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Hyunmin Lee <hn.min.lee@gmail.com>
Subject: mm/vmalloc: replace BUG_ON with a simple if statement
Date: Wed, 1 Feb 2023 20:51:42 +0900

As per the coding standards, in the event of an abnormal condition that
should not occur under normal circumstances, the kernel should attempt
recovery and proceed with execution, rather than halting the machine.

Specifically, in the alloc_vmap_area() function, use a simple if()
instead of using BUG_ON() halting the machine.

Link: https://lkml.kernel.org/r/20230201115142.GA7772@min-iamroot
Co-developed-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Signed-off-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Co-developed-by: Jeungwoo Yoo <casionwoo@gmail.com>
Signed-off-by: Jeungwoo Yoo <casionwoo@gmail.com>
Co-developed-by: Sangyun Kim <sangyun.kim@snu.ac.kr>
Signed-off-by: Sangyun Kim <sangyun.kim@snu.ac.kr>
Signed-off-by: Hyunmin Lee <hn.min.lee@gmail.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Reviewed-by: Mike Rapoport (IBM) <rppt@kernel.org>
Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/vmalloc.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- a/mm/vmalloc.c~mm-vmalloc-replace-bug_on-to-a-simple-if-statement
+++ a/mm/vmalloc.c
@@ -1586,9 +1586,8 @@ static struct vmap_area *alloc_vmap_area
 	int purged = 0;
 	int ret;
 
-	BUG_ON(!size);
-	BUG_ON(offset_in_page(size));
-	BUG_ON(!is_power_of_2(align));
+	if (unlikely(!size || offset_in_page(size) || !is_power_of_2(align)))
+		return ERR_PTR(-EINVAL);
 
 	if (unlikely(!vmap_initialized))
 		return ERR_PTR(-EBUSY);
_

Patches currently in -mm which might be from hn.min.lee@gmail.com are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-10  0:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-10  0:54 [merged mm-stable] mm-vmalloc-replace-bug_on-to-a-simple-if-statement.patch removed from -mm tree Andrew Morton

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.