* [PATCH v2 next] mm,memory_hotplug: set failure reason in offline_pages()
@ 2025-06-25 15:32 Dan Carpenter
2025-06-25 15:34 ` David Hildenbrand
2025-06-25 17:52 ` Oscar Salvador
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2025-06-25 15:32 UTC (permalink / raw)
To: Oscar Salvador, David Hildenbrand
Cc: Andrew Morton, Harry Yoo, Vlastimil Babka, Jonathan Cameron,
linux-mm, linux-kernel, kernel-janitors
The "reason" variable is uninitialized on this error path. It's supposed
to explain why the function failed.
Fixes: e4e2806b639c ("mm,memory_hotplug: implement numa node notifier")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
v2: I misunderstood the reason why the function was failing. Use the
correct reason.
mm/memory_hotplug.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 4d864b4fb891..e4009a44f883 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1977,8 +1977,10 @@ int offline_pages(unsigned long start_pfn, unsigned long nr_pages,
node_arg.nid = node;
ret = node_notify(NODE_REMOVING_LAST_MEMORY, &node_arg);
ret = notifier_to_errno(ret);
- if (ret)
+ if (ret) {
+ reason = "node notifier failure";
goto failed_removal_isolated;
+ }
}
ret = memory_notify(MEM_GOING_OFFLINE, &mem_arg);
--
2.47.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2 next] mm,memory_hotplug: set failure reason in offline_pages()
2025-06-25 15:32 [PATCH v2 next] mm,memory_hotplug: set failure reason in offline_pages() Dan Carpenter
@ 2025-06-25 15:34 ` David Hildenbrand
2025-06-25 17:52 ` Oscar Salvador
1 sibling, 0 replies; 3+ messages in thread
From: David Hildenbrand @ 2025-06-25 15:34 UTC (permalink / raw)
To: Dan Carpenter, Oscar Salvador
Cc: Andrew Morton, Harry Yoo, Vlastimil Babka, Jonathan Cameron,
linux-mm, linux-kernel, kernel-janitors
On 25.06.25 17:32, Dan Carpenter wrote:
> The "reason" variable is uninitialized on this error path. It's supposed
> to explain why the function failed.
>
> Fixes: e4e2806b639c ("mm,memory_hotplug: implement numa node notifier")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> v2: I misunderstood the reason why the function was failing. Use the
> correct reason.
>
> mm/memory_hotplug.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 4d864b4fb891..e4009a44f883 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -1977,8 +1977,10 @@ int offline_pages(unsigned long start_pfn, unsigned long nr_pages,
> node_arg.nid = node;
> ret = node_notify(NODE_REMOVING_LAST_MEMORY, &node_arg);
> ret = notifier_to_errno(ret);
> - if (ret)
> + if (ret) {
> + reason = "node notifier failure";
> goto failed_removal_isolated;
> + }
> }
>
> ret = memory_notify(MEM_GOING_OFFLINE, &mem_arg);
Again, likely to be squashed :)
Acked-by: David Hildenbrand <david@redhat.com>
--
Cheers,
David / dhildenb
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 next] mm,memory_hotplug: set failure reason in offline_pages()
2025-06-25 15:32 [PATCH v2 next] mm,memory_hotplug: set failure reason in offline_pages() Dan Carpenter
2025-06-25 15:34 ` David Hildenbrand
@ 2025-06-25 17:52 ` Oscar Salvador
1 sibling, 0 replies; 3+ messages in thread
From: Oscar Salvador @ 2025-06-25 17:52 UTC (permalink / raw)
To: Dan Carpenter
Cc: David Hildenbrand, Andrew Morton, Harry Yoo, Vlastimil Babka,
Jonathan Cameron, linux-mm, linux-kernel, kernel-janitors
On Wed, Jun 25, 2025 at 10:32:04AM -0500, Dan Carpenter wrote:
> The "reason" variable is uninitialized on this error path. It's supposed
> to explain why the function failed.
>
> Fixes: e4e2806b639c ("mm,memory_hotplug: implement numa node notifier")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Thanks Dan!
Acked-by: Oscar Salvador <osalvador@suse.de>
Although.. we might be in time to squash it, right?
--
Oscar Salvador
SUSE Labs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-06-25 17:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-25 15:32 [PATCH v2 next] mm,memory_hotplug: set failure reason in offline_pages() Dan Carpenter
2025-06-25 15:34 ` David Hildenbrand
2025-06-25 17:52 ` Oscar Salvador
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).