Commit 6d9c1fd4 authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Linus Torvalds

mount options: fix hpfs

Add a .show_options super operation to hpfs.

Use generic_show_options() and save the complete option string in
hpfs_fill_super() and hpfs_remount_fs().

Also add a small fix: hpfs_remount_fs() should return -EINVAL on
error, instead of 1, which is not an error value.
Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
Cc: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent dd2cc4df
...@@ -386,6 +386,7 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data) ...@@ -386,6 +386,7 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data)
int lowercase, conv, eas, chk, errs, chkdsk, timeshift; int lowercase, conv, eas, chk, errs, chkdsk, timeshift;
int o; int o;
struct hpfs_sb_info *sbi = hpfs_sb(s); struct hpfs_sb_info *sbi = hpfs_sb(s);
char *new_opts = kstrdup(data, GFP_KERNEL);
*flags |= MS_NOATIME; *flags |= MS_NOATIME;
...@@ -398,15 +399,15 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data) ...@@ -398,15 +399,15 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data)
if (!(o = parse_opts(data, &uid, &gid, &umask, &lowercase, &conv, if (!(o = parse_opts(data, &uid, &gid, &umask, &lowercase, &conv,
&eas, &chk, &errs, &chkdsk, &timeshift))) { &eas, &chk, &errs, &chkdsk, &timeshift))) {
printk("HPFS: bad mount options.\n"); printk("HPFS: bad mount options.\n");
return 1; goto out_err;
} }
if (o == 2) { if (o == 2) {
hpfs_help(); hpfs_help();
return 1; goto out_err;
} }
if (timeshift != sbi->sb_timeshift) { if (timeshift != sbi->sb_timeshift) {
printk("HPFS: timeshift can't be changed using remount.\n"); printk("HPFS: timeshift can't be changed using remount.\n");
return 1; goto out_err;
} }
unmark_dirty(s); unmark_dirty(s);
...@@ -419,7 +420,14 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data) ...@@ -419,7 +420,14 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data)
if (!(*flags & MS_RDONLY)) mark_dirty(s); if (!(*flags & MS_RDONLY)) mark_dirty(s);
kfree(s->s_options);
s->s_options = new_opts;
return 0; return 0;
out_err:
kfree(new_opts);
return -EINVAL;
} }
/* Super operations */ /* Super operations */
...@@ -432,6 +440,7 @@ static const struct super_operations hpfs_sops = ...@@ -432,6 +440,7 @@ static const struct super_operations hpfs_sops =
.put_super = hpfs_put_super, .put_super = hpfs_put_super,
.statfs = hpfs_statfs, .statfs = hpfs_statfs,
.remount_fs = hpfs_remount_fs, .remount_fs = hpfs_remount_fs,
.show_options = generic_show_options,
}; };
static int hpfs_fill_super(struct super_block *s, void *options, int silent) static int hpfs_fill_super(struct super_block *s, void *options, int silent)
...@@ -454,6 +463,8 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent) ...@@ -454,6 +463,8 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent)
int o; int o;
save_mount_options(s, options);
sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
if (!sbi) if (!sbi)
return -ENOMEM; return -ENOMEM;
......
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