Skip to content

Commit e3df4c6

Browse files
Michal Hockotorvalds
authored andcommitted
mm, memory_hotplug: __offline_pages fix wrong locking
Jan has noticed that we do double unlock on some failure paths when offlining a page range. This is indeed the case when test_pages_in_a_zone respp. start_isolate_page_range fail. This was an omission when forward porting the debugging patch from an older kernel. Fix the issue by dropping mem_hotplug_done from the failure condition and keeping the single unlock in the catch all failure path. Link: http://lkml.kernel.org/r/20190115120307.22768-1-mhocko@kernel.org Fixes: 7960509 ("mm, memory_hotplug: print reason for the offlining failure") Signed-off-by: Michal Hocko <mhocko@suse.com> Reported-by: Jan Kara <jack@suse.cz> Reviewed-by: Jan Kara <jack@suse.cz> Tested-by: Jan Kara <jack@suse.cz> Reviewed-by: Oscar Salvador <osalvador@suse.de> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 6376360 commit e3df4c6

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

mm/memory_hotplug.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,7 +1570,6 @@ static int __ref __offline_pages(unsigned long start_pfn,
15701570
we assume this for now. .*/
15711571
if (!test_pages_in_a_zone(start_pfn, end_pfn, &valid_start,
15721572
&valid_end)) {
1573-
mem_hotplug_done();
15741573
ret = -EINVAL;
15751574
reason = "multizone range";
15761575
goto failed_removal;
@@ -1585,7 +1584,6 @@ static int __ref __offline_pages(unsigned long start_pfn,
15851584
MIGRATE_MOVABLE,
15861585
SKIP_HWPOISON | REPORT_FAILURE);
15871586
if (ret) {
1588-
mem_hotplug_done();
15891587
reason = "failure to isolate range";
15901588
goto failed_removal;
15911589
}

0 commit comments

Comments
 (0)