Commit 360ee2d5 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] remount: forced-ro filesystems

 - a bunch of r/o filesystems did force MS_RDONLY on mount but forgot to
   do the same on remount.  Fixed.
parent b7a7eb6e
...@@ -193,6 +193,12 @@ static void cramfs_put_super(struct super_block *sb) ...@@ -193,6 +193,12 @@ static void cramfs_put_super(struct super_block *sb)
sb->s_fs_info = NULL; sb->s_fs_info = NULL;
} }
static int cramfs_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_RDONLY;
return 0;
}
static int cramfs_fill_super(struct super_block *sb, void *data, int silent) static int cramfs_fill_super(struct super_block *sb, void *data, int silent)
{ {
int i; int i;
...@@ -483,6 +489,7 @@ static struct inode_operations cramfs_dir_inode_operations = { ...@@ -483,6 +489,7 @@ static struct inode_operations cramfs_dir_inode_operations = {
static struct super_operations cramfs_ops = { static struct super_operations cramfs_ops = {
.put_super = cramfs_put_super, .put_super = cramfs_put_super,
.remount_fs = cramfs_remount,
.statfs = cramfs_statfs, .statfs = cramfs_statfs,
}; };
......
...@@ -77,12 +77,19 @@ void efs_put_super(struct super_block *s) ...@@ -77,12 +77,19 @@ void efs_put_super(struct super_block *s)
s->s_fs_info = NULL; s->s_fs_info = NULL;
} }
static int efs_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_RDONLY;
return 0;
}
static struct super_operations efs_superblock_operations = { static struct super_operations efs_superblock_operations = {
.alloc_inode = efs_alloc_inode, .alloc_inode = efs_alloc_inode,
.destroy_inode = efs_destroy_inode, .destroy_inode = efs_destroy_inode,
.read_inode = efs_read_inode, .read_inode = efs_read_inode,
.put_super = efs_put_super, .put_super = efs_put_super,
.statfs = efs_statfs, .statfs = efs_statfs,
.remount_fs = efs_remount,
}; };
static int __init init_efs_fs(void) { static int __init init_efs_fs(void) {
......
...@@ -56,12 +56,14 @@ MODULE_ALIAS("vxfs"); /* makes mount -t vxfs autoload the module */ ...@@ -56,12 +56,14 @@ MODULE_ALIAS("vxfs"); /* makes mount -t vxfs autoload the module */
static void vxfs_put_super(struct super_block *); static void vxfs_put_super(struct super_block *);
static int vxfs_statfs(struct super_block *, struct kstatfs *); static int vxfs_statfs(struct super_block *, struct kstatfs *);
static int vxfs_remount(struct super_block *, int *, char *);
static struct super_operations vxfs_super_ops = { static struct super_operations vxfs_super_ops = {
.read_inode = vxfs_read_inode, .read_inode = vxfs_read_inode,
.put_inode = vxfs_put_inode, .put_inode = vxfs_put_inode,
.put_super = vxfs_put_super, .put_super = vxfs_put_super,
.statfs = vxfs_statfs, .statfs = vxfs_statfs,
.remount_fs = vxfs_remount,
}; };
/** /**
...@@ -121,6 +123,12 @@ vxfs_statfs(struct super_block *sbp, struct kstatfs *bufp) ...@@ -121,6 +123,12 @@ vxfs_statfs(struct super_block *sbp, struct kstatfs *bufp)
return 0; return 0;
} }
static int vxfs_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_RDONLY;
return 0;
}
/** /**
* vxfs_read_super - read superblock into memory and initalize filesystem * vxfs_read_super - read superblock into memory and initalize filesystem
* @sbp: VFS superblock (to fill) * @sbp: VFS superblock (to fill)
......
...@@ -119,12 +119,20 @@ static void destroy_inodecache(void) ...@@ -119,12 +119,20 @@ static void destroy_inodecache(void)
printk(KERN_INFO "iso_inode_cache: not all structures were freed\n"); printk(KERN_INFO "iso_inode_cache: not all structures were freed\n");
} }
static int isofs_remount(struct super_block *sb, int *flags, char *data)
{
/* we probably want a lot more here */
*flags |= MS_RDONLY;
return 0;
}
static struct super_operations isofs_sops = { static struct super_operations isofs_sops = {
.alloc_inode = isofs_alloc_inode, .alloc_inode = isofs_alloc_inode,
.destroy_inode = isofs_destroy_inode, .destroy_inode = isofs_destroy_inode,
.read_inode = isofs_read_inode, .read_inode = isofs_read_inode,
.put_super = isofs_put_super, .put_super = isofs_put_super,
.statfs = isofs_statfs, .statfs = isofs_statfs,
.remount_fs = isofs_remount,
}; };
/* the export_operations structure for describing /* the export_operations structure for describing
......
...@@ -149,9 +149,13 @@ static int qnx4_remount(struct super_block *sb, int *flags, char *data) ...@@ -149,9 +149,13 @@ static int qnx4_remount(struct super_block *sb, int *flags, char *data)
qs = qnx4_sb(sb); qs = qnx4_sb(sb);
qs->Version = QNX4_VERSION; qs->Version = QNX4_VERSION;
#ifndef CONFIG_QNX4FS_RW
*flags |= MS_RDONLY;
#endif
if (*flags & MS_RDONLY) { if (*flags & MS_RDONLY) {
return 0; return 0;
} }
mark_buffer_dirty(qs->sb_buf); mark_buffer_dirty(qs->sb_buf);
return 0; return 0;
......
...@@ -592,11 +592,18 @@ static void destroy_inodecache(void) ...@@ -592,11 +592,18 @@ static void destroy_inodecache(void)
printk(KERN_INFO "romfs_inode_cache: not all structures were freed\n"); printk(KERN_INFO "romfs_inode_cache: not all structures were freed\n");
} }
static int romfs_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_RDONLY;
return 0;
}
static struct super_operations romfs_ops = { static struct super_operations romfs_ops = {
.alloc_inode = romfs_alloc_inode, .alloc_inode = romfs_alloc_inode,
.destroy_inode = romfs_destroy_inode, .destroy_inode = romfs_destroy_inode,
.read_inode = romfs_read_inode, .read_inode = romfs_read_inode,
.statfs = romfs_statfs, .statfs = romfs_statfs,
.remount_fs = romfs_remount,
}; };
static struct super_block *romfs_get_sb(struct file_system_type *fs_type, static struct super_block *romfs_get_sb(struct file_system_type *fs_type,
......
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