diff options
author | Dave Hansen <dave.hansen@linux.intel.com> | 2019-02-25 10:57:30 -0800 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2019-02-28 10:41:23 -0800 |
commit | 5cd401ace914dc68556c6d2fcae0c349444d5f86 (patch) | |
tree | d9eda233940338a952cd22f6c596aa478d3d5198 /mm/debug.c | |
parent | c347bd71dcdb2d0ac8b3a771486584dca8c8dd80 (diff) | |
download | linux-5cd401ace914dc68556c6d2fcae0c349444d5f86.tar.gz linux-5cd401ace914dc68556c6d2fcae0c349444d5f86.tar.bz2 linux-5cd401ace914dc68556c6d2fcae0c349444d5f86.zip |
mm/resource: Return real error codes from walk failures
walk_system_ram_range() can return an error code either becuase
*it* failed, or because the 'func' that it calls returned an
error. The memory hotplug does the following:
ret = walk_system_ram_range(..., func);
if (ret)
return ret;
and 'ret' makes it out to userspace, eventually. The problem
s, walk_system_ram_range() failues that result from *it* failing
(as opposed to 'func') return -1. That leads to a very odd
-EPERM (-1) return code out to userspace.
Make walk_system_ram_range() return -EINVAL for internal
failures to keep userspace less confused.
This return code is compatible with all the callers that I
audited.
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Ross Zwisler <zwisler@kernel.org>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: linux-nvdimm@lists.01.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org
Cc: Huang Ying <ying.huang@intel.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Keith Busch <keith.busch@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'mm/debug.c')
0 files changed, 0 insertions, 0 deletions