Skip to content

Commit 349111f

Browse files
committed
Merge branch 'akpm' (patches from Andrew)
Merge misc fixes from Andrew Morton: "11 patches. Subsystems affected by this: misc, mm/hugetlb, mm/vmalloc, mm/misc, romfs, relay, uprobes, squashfs, mm/cma, mm/pagealloc" * emailed patches from Andrew Morton <[email protected]>: mm, page_alloc: fix core hung in free_pcppages_bulk() mm: include CMA pages in lowmem_reserve at boot squashfs: avoid bio_alloc() failure with 1Mbyte blocks uprobes: __replace_page() avoid BUG in munlock_vma_page() kernel/relay.c: fix memleak on destroy relay channel romfs: fix uninitialized memory leak in romfs_dev_read() mm/rodata_test.c: fix missing function declaration mm/vunmap: add cond_resched() in vunmap_pmd_range khugepaged: adjust VM_BUG_ON_MM() in __khugepaged_enter() hugetlb_cgroup: convert comma to semicolon mailmap: add Andi Kleen
2 parents f22c557 + 88e8ac1 commit 349111f

File tree

10 files changed

+21
-9
lines changed

10 files changed

+21
-9
lines changed

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Alex Shi <[email protected]> <[email protected]>
3232
3333
3434
35+
3536
3637
Andreas Herrmann <[email protected]>
3738
Andrew Morton <[email protected]>

fs/romfs/storage.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,8 @@ int romfs_dev_read(struct super_block *sb, unsigned long pos,
217217
size_t limit;
218218

219219
limit = romfs_maxsize(sb);
220-
if (pos >= limit)
220+
if (pos >= limit || buflen > limit - pos)
221221
return -EIO;
222-
if (buflen > limit - pos)
223-
buflen = limit - pos;
224222

225223
#ifdef CONFIG_ROMFS_ON_MTD
226224
if (sb->s_mtd)

fs/squashfs/block.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ static int squashfs_bio_read(struct super_block *sb, u64 index, int length,
8787
int error, i;
8888
struct bio *bio;
8989

90-
bio = bio_alloc(GFP_NOIO, page_count);
90+
if (page_count <= BIO_MAX_PAGES)
91+
bio = bio_alloc(GFP_NOIO, page_count);
92+
else
93+
bio = bio_kmalloc(GFP_NOIO, page_count);
94+
9195
if (!bio)
9296
return -ENOMEM;
9397

kernel/events/uprobes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ static int __replace_page(struct vm_area_struct *vma, unsigned long addr,
205205
try_to_free_swap(old_page);
206206
page_vma_mapped_walk_done(&pvmw);
207207

208-
if (vma->vm_flags & VM_LOCKED)
208+
if ((vma->vm_flags & VM_LOCKED) && !PageCompound(old_page))
209209
munlock_vma_page(old_page);
210210
put_page(old_page);
211211

kernel/relay.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ static struct rchan_buf *relay_create_buf(struct rchan *chan)
197197
static void relay_destroy_channel(struct kref *kref)
198198
{
199199
struct rchan *chan = container_of(kref, struct rchan, kref);
200+
free_percpu(chan->buf);
200201
kfree(chan);
201202
}
202203

mm/hugetlb_cgroup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ static void __init __hugetlb_cgroup_file_dfl_init(int idx)
655655
snprintf(cft->name, MAX_CFTYPE_NAME, "%s.events", buf);
656656
cft->private = MEMFILE_PRIVATE(idx, 0);
657657
cft->seq_show = hugetlb_events_show;
658-
cft->file_offset = offsetof(struct hugetlb_cgroup, events_file[idx]),
658+
cft->file_offset = offsetof(struct hugetlb_cgroup, events_file[idx]);
659659
cft->flags = CFTYPE_NOT_ON_ROOT;
660660

661661
/* Add the events.local file */
@@ -664,7 +664,7 @@ static void __init __hugetlb_cgroup_file_dfl_init(int idx)
664664
cft->private = MEMFILE_PRIVATE(idx, 0);
665665
cft->seq_show = hugetlb_events_local_show;
666666
cft->file_offset = offsetof(struct hugetlb_cgroup,
667-
events_local_file[idx]),
667+
events_local_file[idx]);
668668
cft->flags = CFTYPE_NOT_ON_ROOT;
669669

670670
/* NULL terminate the last cft */

mm/khugepaged.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ int __khugepaged_enter(struct mm_struct *mm)
466466
return -ENOMEM;
467467

468468
/* __khugepaged_exit() must not run from under us */
469-
VM_BUG_ON_MM(khugepaged_test_exit(mm), mm);
469+
VM_BUG_ON_MM(atomic_read(&mm->mm_users) == 0, mm);
470470
if (unlikely(test_and_set_bit(MMF_VM_HUGEPAGE, &mm->flags))) {
471471
free_mm_slot(mm_slot);
472472
return 0;

mm/page_alloc.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,11 @@ static void free_pcppages_bulk(struct zone *zone, int count,
13021302
struct page *page, *tmp;
13031303
LIST_HEAD(head);
13041304

1305+
/*
1306+
* Ensure proper count is passed which otherwise would stuck in the
1307+
* below while (list_empty(list)) loop.
1308+
*/
1309+
count = min(pcp->count, count);
13051310
while (count) {
13061311
struct list_head *list;
13071312

@@ -7888,7 +7893,7 @@ int __meminit init_per_zone_wmark_min(void)
78887893

78897894
return 0;
78907895
}
7891-
core_initcall(init_per_zone_wmark_min)
7896+
postcore_initcall(init_per_zone_wmark_min)
78927897

78937898
/*
78947899
* min_free_kbytes_sysctl_handler - just a wrapper around proc_dointvec() so

mm/rodata_test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88
#define pr_fmt(fmt) "rodata_test: " fmt
99

10+
#include <linux/rodata_test.h>
1011
#include <linux/uaccess.h>
1112
#include <asm/sections.h>
1213

mm/vmalloc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ static void vunmap_pmd_range(pud_t *pud, unsigned long addr, unsigned long end,
104104
if (pmd_none_or_clear_bad(pmd))
105105
continue;
106106
vunmap_pte_range(pmd, addr, next, mask);
107+
108+
cond_resched();
107109
} while (pmd++, addr = next, addr != end);
108110
}
109111

0 commit comments

Comments
 (0)