|
@@ -2486,6 +2486,7 @@ static int shmem_remount_fs(struct super_block *sb, int *flags, char *data)
|
|
unsigned long inodes;
|
|
unsigned long inodes;
|
|
int error = -EINVAL;
|
|
int error = -EINVAL;
|
|
|
|
|
|
|
|
+ config.mpol = NULL;
|
|
if (shmem_parse_options(data, &config, true))
|
|
if (shmem_parse_options(data, &config, true))
|
|
return error;
|
|
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->max_inodes = config.max_inodes;
|
|
sbinfo->free_inodes = config.max_inodes - 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:
|
|
out:
|
|
spin_unlock(&sbinfo->stat_lock);
|
|
spin_unlock(&sbinfo->stat_lock);
|
|
return error;
|
|
return error;
|