]> git.baikalelectronics.ru Git - kernel.git/commit
kdump: return -ENOENT if required cmdline option does not exist
authorZhen Lei <thunder.leizhen@huawei.com>
Fri, 6 May 2022 11:43:57 +0000 (19:43 +0800)
committerCatalin Marinas <catalin.marinas@arm.com>
Sat, 7 May 2022 18:54:33 +0000 (19:54 +0100)
commit2ae759b5043d2c8000df963b99724def2865e887
tree703c1312ca48a5031c92b7b8765d297f9f7fe531
parent8dd3e26bbbc758feb75d55e38f0ba1ef6979f6d1
kdump: return -ENOENT if required cmdline option does not exist

According to the current crashkernel=Y,low support in other ARCHes, it's
an optional command-line option. When it doesn't exist, kernel will try
to allocate minimum required memory below 4G automatically.

However, __parse_crashkernel() returns '-EINVAL' for all error cases. It
can't distinguish the nonexistent option from invalid option.

Change __parse_crashkernel() to return '-ENOENT' for the nonexistent option
case. With this change, crashkernel,low memory will take the default
value if crashkernel=,low is not specified; while crashkernel reservation
will fail and bail out if an invalid option is specified.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Acked-by: Baoquan He <bhe@redhat.com>
Link: https://lore.kernel.org/r/20220506114402.365-2-thunder.leizhen@huawei.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
kernel/crash_core.c