Commit 191a3afa authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'akpm' (patches from Andrew)

Merge fixes from Andrew Morton:
 "5 fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  mm: memcg: fix use after free in mem_cgroup_iter()
  mm/huge_memory.c: fix data loss when splitting a file pmd
  fat: fix memory allocation failure handling of match_strdup()
  MAINTAINERS: Peter has moved
  mm/memblock: add missing include <linux/bootmem.h>
parents 48e5aee8 9f15bde6
...@@ -9074,7 +9074,7 @@ S: Maintained ...@@ -9074,7 +9074,7 @@ S: Maintained
F: drivers/usb/mtu3/ F: drivers/usb/mtu3/
MEGACHIPS STDPXXXX-GE-B850V3-FW LVDS/DP++ BRIDGES MEGACHIPS STDPXXXX-GE-B850V3-FW LVDS/DP++ BRIDGES
M: Peter Senna Tschudin <peter.senna@collabora.com> M: Peter Senna Tschudin <peter.senna@gmail.com>
M: Martin Donnelly <martin.donnelly@ge.com> M: Martin Donnelly <martin.donnelly@ge.com>
M: Martyn Welch <martyn.welch@collabora.co.uk> M: Martyn Welch <martyn.welch@collabora.co.uk>
S: Maintained S: Maintained
......
...@@ -707,13 +707,21 @@ static void fat_set_state(struct super_block *sb, ...@@ -707,13 +707,21 @@ static void fat_set_state(struct super_block *sb,
brelse(bh); brelse(bh);
} }
static void fat_reset_iocharset(struct fat_mount_options *opts)
{
if (opts->iocharset != fat_default_iocharset) {
/* Note: opts->iocharset can be NULL here */
kfree(opts->iocharset);
opts->iocharset = fat_default_iocharset;
}
}
static void delayed_free(struct rcu_head *p) static void delayed_free(struct rcu_head *p)
{ {
struct msdos_sb_info *sbi = container_of(p, struct msdos_sb_info, rcu); struct msdos_sb_info *sbi = container_of(p, struct msdos_sb_info, rcu);
unload_nls(sbi->nls_disk); unload_nls(sbi->nls_disk);
unload_nls(sbi->nls_io); unload_nls(sbi->nls_io);
if (sbi->options.iocharset != fat_default_iocharset) fat_reset_iocharset(&sbi->options);
kfree(sbi->options.iocharset);
kfree(sbi); kfree(sbi);
} }
...@@ -1132,7 +1140,7 @@ static int parse_options(struct super_block *sb, char *options, int is_vfat, ...@@ -1132,7 +1140,7 @@ static int parse_options(struct super_block *sb, char *options, int is_vfat,
opts->fs_fmask = opts->fs_dmask = current_umask(); opts->fs_fmask = opts->fs_dmask = current_umask();
opts->allow_utime = -1; opts->allow_utime = -1;
opts->codepage = fat_default_codepage; opts->codepage = fat_default_codepage;
opts->iocharset = fat_default_iocharset; fat_reset_iocharset(opts);
if (is_vfat) { if (is_vfat) {
opts->shortname = VFAT_SFN_DISPLAY_WINNT|VFAT_SFN_CREATE_WIN95; opts->shortname = VFAT_SFN_DISPLAY_WINNT|VFAT_SFN_CREATE_WIN95;
opts->rodir = 0; opts->rodir = 0;
...@@ -1289,8 +1297,7 @@ static int parse_options(struct super_block *sb, char *options, int is_vfat, ...@@ -1289,8 +1297,7 @@ static int parse_options(struct super_block *sb, char *options, int is_vfat,
/* vfat specific */ /* vfat specific */
case Opt_charset: case Opt_charset:
if (opts->iocharset != fat_default_iocharset) fat_reset_iocharset(opts);
kfree(opts->iocharset);
iocharset = match_strdup(&args[0]); iocharset = match_strdup(&args[0]);
if (!iocharset) if (!iocharset)
return -ENOMEM; return -ENOMEM;
...@@ -1881,8 +1888,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat, ...@@ -1881,8 +1888,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat,
iput(fat_inode); iput(fat_inode);
unload_nls(sbi->nls_io); unload_nls(sbi->nls_io);
unload_nls(sbi->nls_disk); unload_nls(sbi->nls_disk);
if (sbi->options.iocharset != fat_default_iocharset) fat_reset_iocharset(&sbi->options);
kfree(sbi->options.iocharset);
sb->s_fs_info = NULL; sb->s_fs_info = NULL;
kfree(sbi); kfree(sbi);
return error; return error;
......
...@@ -2084,6 +2084,8 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd, ...@@ -2084,6 +2084,8 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd,
if (vma_is_dax(vma)) if (vma_is_dax(vma))
return; return;
page = pmd_page(_pmd); page = pmd_page(_pmd);
if (!PageDirty(page) && pmd_dirty(_pmd))
set_page_dirty(page);
if (!PageReferenced(page) && pmd_young(_pmd)) if (!PageReferenced(page) && pmd_young(_pmd))
SetPageReferenced(page); SetPageReferenced(page);
page_remove_rmap(page, true); page_remove_rmap(page, true);
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/kmemleak.h> #include <linux/kmemleak.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/memblock.h> #include <linux/memblock.h>
#include <linux/bootmem.h>
#include <asm/sections.h> #include <asm/sections.h>
#include <linux/io.h> #include <linux/io.h>
...@@ -1225,6 +1226,7 @@ phys_addr_t __init memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, i ...@@ -1225,6 +1226,7 @@ phys_addr_t __init memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, i
return memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ACCESSIBLE); return memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ACCESSIBLE);
} }
#if defined(CONFIG_NO_BOOTMEM)
/** /**
* memblock_virt_alloc_internal - allocate boot memory block * memblock_virt_alloc_internal - allocate boot memory block
* @size: size of memory block to be allocated in bytes * @size: size of memory block to be allocated in bytes
...@@ -1432,6 +1434,7 @@ void * __init memblock_virt_alloc_try_nid( ...@@ -1432,6 +1434,7 @@ void * __init memblock_virt_alloc_try_nid(
(u64)max_addr); (u64)max_addr);
return NULL; return NULL;
} }
#endif
/** /**
* __memblock_free_early - free boot memory block * __memblock_free_early - free boot memory block
......
...@@ -850,7 +850,7 @@ static void invalidate_reclaim_iterators(struct mem_cgroup *dead_memcg) ...@@ -850,7 +850,7 @@ static void invalidate_reclaim_iterators(struct mem_cgroup *dead_memcg)
int nid; int nid;
int i; int i;
while ((memcg = parent_mem_cgroup(memcg))) { for (; memcg; memcg = parent_mem_cgroup(memcg)) {
for_each_node(nid) { for_each_node(nid) {
mz = mem_cgroup_nodeinfo(memcg, nid); mz = mem_cgroup_nodeinfo(memcg, nid);
for (i = 0; i <= DEF_PRIORITY; i++) { for (i = 0; i <= DEF_PRIORITY; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment