aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/shmem.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 7162c58355b1..5e2ff592e3b8 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2486,6 +2486,7 @@ static int shmem_remount_fs(struct super_block *sb, int *flags, char *data)
2486 unsigned long inodes; 2486 unsigned long inodes;
2487 int error = -EINVAL; 2487 int error = -EINVAL;
2488 2488
2489 config.mpol = NULL;
2489 if (shmem_parse_options(data, &config, true)) 2490 if (shmem_parse_options(data, &config, true))
2490 return error; 2491 return error;
2491 2492
@@ -2510,8 +2511,13 @@ static int shmem_remount_fs(struct super_block *sb, int *flags, char *data)
2510 sbinfo->max_inodes = config.max_inodes; 2511 sbinfo->max_inodes = config.max_inodes;
2511 sbinfo->free_inodes = config.max_inodes - inodes; 2512 sbinfo->free_inodes = config.max_inodes - inodes;
2512 2513
2513 mpol_put(sbinfo->mpol); 2514 /*
2514 sbinfo->mpol = config.mpol; /* transfers initial ref */ 2515 * Preserve previous mempolicy unless mpol remount option was specified.
2516 */
2517 if (config.mpol) {
2518 mpol_put(sbinfo->mpol);
2519 sbinfo->mpol = config.mpol; /* transfers initial ref */
2520 }
2515out: 2521out:
2516 spin_unlock(&sbinfo->stat_lock); 2522 spin_unlock(&sbinfo->stat_lock);
2517 return error; 2523 return error;