From ea265455bb7a162e311baca5c63b647b58f77125 Mon Sep 17 00:00:00 2001 From: Greg Thelen Date: Fri, 22 Feb 2013 16:36:01 -0800 Subject: [PATCH] --- yaml --- r: 356625 b: refs/heads/master c: 5f00110f7273f9ff04ac69a5f85bb535a4fd0987 h: refs/heads/master i: 356623: 034736019a847e1c2c14488857a84fda987730a2 v: v3 --- [refs] | 2 +- trunk/mm/shmem.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index b68f6221f511..d2868bc66a70 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 67d46b296a1ba1477c0df8ff3bc5e0167a0b0732 +refs/heads/master: 5f00110f7273f9ff04ac69a5f85bb535a4fd0987 diff --git a/trunk/mm/shmem.c b/trunk/mm/shmem.c index 7162c58355b1..5e2ff592e3b8 100644 --- a/trunk/mm/shmem.c +++ b/trunk/mm/shmem.c @@ -2486,6 +2486,7 @@ static int shmem_remount_fs(struct super_block *sb, int *flags, char *data) unsigned long inodes; int error = -EINVAL; + config.mpol = NULL; if (shmem_parse_options(data, &config, true)) return error; @@ -2510,8 +2511,13 @@ static int shmem_remount_fs(struct super_block *sb, int *flags, char *data) sbinfo->max_inodes = config.max_inodes; sbinfo->free_inodes = config.max_inodes - inodes; - mpol_put(sbinfo->mpol); - sbinfo->mpol = config.mpol; /* transfers initial ref */ + /* + * Preserve previous mempolicy unless mpol remount option was specified. + */ + if (config.mpol) { + mpol_put(sbinfo->mpol); + sbinfo->mpol = config.mpol; /* transfers initial ref */ + } out: spin_unlock(&sbinfo->stat_lock); return error;