forked from Minki/linux
mount options: fix affs
Add a .show_options super operation to affs. Use generic_show_options() and save the complete option string in affs_fill_super() and affs_remount(). Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Cc: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
e11400b0ca
commit
e9b3961b66
@ -122,6 +122,7 @@ static const struct super_operations affs_sops = {
|
|||||||
.write_super = affs_write_super,
|
.write_super = affs_write_super,
|
||||||
.statfs = affs_statfs,
|
.statfs = affs_statfs,
|
||||||
.remount_fs = affs_remount,
|
.remount_fs = affs_remount,
|
||||||
|
.show_options = generic_show_options,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@ -272,6 +273,8 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
|
|||||||
u8 sig[4];
|
u8 sig[4];
|
||||||
int ret = -EINVAL;
|
int ret = -EINVAL;
|
||||||
|
|
||||||
|
save_mount_options(sb, data);
|
||||||
|
|
||||||
pr_debug("AFFS: read_super(%s)\n",data ? (const char *)data : "no options");
|
pr_debug("AFFS: read_super(%s)\n",data ? (const char *)data : "no options");
|
||||||
|
|
||||||
sb->s_magic = AFFS_SUPER_MAGIC;
|
sb->s_magic = AFFS_SUPER_MAGIC;
|
||||||
@ -487,14 +490,21 @@ affs_remount(struct super_block *sb, int *flags, char *data)
|
|||||||
int root_block;
|
int root_block;
|
||||||
unsigned long mount_flags;
|
unsigned long mount_flags;
|
||||||
int res = 0;
|
int res = 0;
|
||||||
|
char *new_opts = kstrdup(data, GFP_KERNEL);
|
||||||
|
|
||||||
pr_debug("AFFS: remount(flags=0x%x,opts=\"%s\")\n",*flags,data);
|
pr_debug("AFFS: remount(flags=0x%x,opts=\"%s\")\n",*flags,data);
|
||||||
|
|
||||||
*flags |= MS_NODIRATIME;
|
*flags |= MS_NODIRATIME;
|
||||||
|
|
||||||
if (!parse_options(data,&uid,&gid,&mode,&reserved,&root_block,
|
if (!parse_options(data, &uid, &gid, &mode, &reserved, &root_block,
|
||||||
&blocksize,&sbi->s_prefix,sbi->s_volume,&mount_flags))
|
&blocksize, &sbi->s_prefix, sbi->s_volume,
|
||||||
|
&mount_flags)) {
|
||||||
|
kfree(new_opts);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
kfree(sb->s_options);
|
||||||
|
sb->s_options = new_opts;
|
||||||
|
|
||||||
sbi->s_flags = mount_flags;
|
sbi->s_flags = mount_flags;
|
||||||
sbi->s_mode = mode;
|
sbi->s_mode = mode;
|
||||||
sbi->s_uid = uid;
|
sbi->s_uid = uid;
|
||||||
|
Loading…
Reference in New Issue
Block a user