summaryrefslogtreecommitdiffstats
path: root/fs/adfs
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2019-06-04 15:50:09 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2019-06-27 02:14:14 +0200
commit4c5762f5f5e31d493678b0ee6f73585355dd3638 (patch)
tree64e50ca6142ff261d5d412f7912ba1af10f14bc4 /fs/adfs
parentfs/adfs: super: correct superblock flags (diff)
downloadlinux-4c5762f5f5e31d493678b0ee6f73585355dd3638.tar.xz
linux-4c5762f5f5e31d493678b0ee6f73585355dd3638.zip
fs/adfs: super: safely update options on remount
Only update the options on remount if we successfully parse all options, rather than updating those we've managed to parse. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/adfs')
-rw-r--r--fs/adfs/super.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/fs/adfs/super.c b/fs/adfs/super.c
index b393905abe13..2f81c1c29757 100644
--- a/fs/adfs/super.c
+++ b/fs/adfs/super.c
@@ -170,10 +170,10 @@ static const match_table_t tokens = {
{Opt_err, NULL}
};
-static int parse_options(struct super_block *sb, char *options)
+static int parse_options(struct super_block *sb, struct adfs_sb_info *asb,
+ char *options)
{
char *p;
- struct adfs_sb_info *asb = ADFS_SB(sb);
int option;
if (!options)
@@ -228,9 +228,18 @@ static int parse_options(struct super_block *sb, char *options)
static int adfs_remount(struct super_block *sb, int *flags, char *data)
{
+ struct adfs_sb_info temp_asb;
+ int ret;
+
sync_filesystem(sb);
*flags |= ADFS_SB_FLAGS;
- return parse_options(sb, data);
+
+ temp_asb = *ADFS_SB(sb);
+ ret = parse_options(sb, &temp_asb, data);
+ if (ret == 0)
+ *ADFS_SB(sb) = temp_asb;
+
+ return ret;
}
static int adfs_statfs(struct dentry *dentry, struct kstatfs *buf)
@@ -387,7 +396,7 @@ static int adfs_fill_super(struct super_block *sb, void *data, int silent)
asb->s_other_mask = ADFS_DEFAULT_OTHER_MASK;
asb->s_ftsuffix = 0;
- if (parse_options(sb, data))
+ if (parse_options(sb, asb, data))
goto error;
sb_set_blocksize(sb, BLOCK_SIZE);