Re: [PATCH v2 2/2] hugetlb: Fix return value of __setup handlers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2022/4/1 18:46, David Hildenbrand wrote:
On 01.04.22 12:12, Peng Liu wrote:
When __setup() return '0', using invalid option values causes the
entire kernel boot option string to be reported as Unknown. Hugetlb
calls __setup() and will return '0' when set invalid parameter
string.

The following phenomenon is observed:
 cmdline:
  hugepagesz=1Y hugepages=1
 dmesg:
  HugeTLB: unsupported hugepagesz=1Y
  HugeTLB: hugepages=1 does not follow a valid hugepagesz, ignoring
  Unknown kernel command line parameters "hugepagesz=1Y hugepages=1"

Since hugetlb will print warn or error information before return for
invalid parameter string, just use return '1' to avoid print again.

Signed-off-by: Peng Liu <liupeng256@xxxxxxxxxx>
---
 mm/hugetlb.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 9cd746432ca9..6dde34c115c9 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -4131,12 +4131,11 @@ static int __init hugepages_setup(char *s)
 	int count;
 	unsigned long tmp;
 	char *p = s;
-	int ret = 1;
Adding this in #1 to remove it in #2 is a bit sub-optimal IMHO.

For #2, which is not necessary for stable, #1 may be needed for
stable, this is why we split #2 into a single patch.

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux