]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] remount: forced-ro filesystems
authorAlexander Viro <viro@www.linux.org.uk>
Fri, 16 Apr 2004 07:27:28 +0000 (00:27 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 16 Apr 2004 07:27:28 +0000 (00:27 -0700)
 - a bunch of r/o filesystems did force MS_RDONLY on mount but forgot to
   do the same on remount.  Fixed.

fs/cramfs/inode.c
fs/efs/super.c
fs/freevxfs/vxfs_super.c
fs/isofs/inode.c
fs/qnx4/inode.c
fs/romfs/inode.c

index 89e7b3d1db42a6f9a6af72e07b5a91e1cbc68254..23099366a8884025b21ecb9f2d3fd8e62085738d 100644 (file)
@@ -193,6 +193,12 @@ static void cramfs_put_super(struct super_block *sb)
        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)
 {
        int i;
@@ -483,6 +489,7 @@ static struct inode_operations cramfs_dir_inode_operations = {
 
 static struct super_operations cramfs_ops = {
        .put_super      = cramfs_put_super,
+       .remount_fs     = cramfs_remount,
        .statfs         = cramfs_statfs,
 };
 
index 0d26cac157a8b71893a5c2f8d50eeed248f59a48..d4910e43a154af4ddc3428c680d288d3c5eb5fa2 100644 (file)
@@ -77,12 +77,19 @@ void efs_put_super(struct super_block *s)
        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 = {
        .alloc_inode    = efs_alloc_inode,
        .destroy_inode  = efs_destroy_inode,
        .read_inode     = efs_read_inode,
        .put_super      = efs_put_super,
        .statfs         = efs_statfs,
+       .remount_fs     = efs_remount,
 };
 
 static int __init init_efs_fs(void) {
index ebac447cc2009fa3740dd56b852dfa6682e2ec81..8fcec56e9ad49fa1fa143f5e15a8f8cb5828b02b 100644 (file)
@@ -56,12 +56,14 @@ MODULE_ALIAS("vxfs"); /* makes mount -t vxfs autoload the module */
 
 static void            vxfs_put_super(struct super_block *);
 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 = {
        .read_inode =           vxfs_read_inode,
        .put_inode =            vxfs_put_inode,
        .put_super =            vxfs_put_super,
        .statfs =               vxfs_statfs,
+       .remount_fs =           vxfs_remount,
 };
 
 /**
@@ -121,6 +123,12 @@ vxfs_statfs(struct super_block *sbp, struct kstatfs *bufp)
        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
  * @sbp:               VFS superblock (to fill)
index 0c21ca81fc7e63ff5e8f23e9cb05c5718ecee0ef..7fd9a89aaa1411088d1c5e921b4993b345f1f8b9 100644 (file)
@@ -119,12 +119,20 @@ static void destroy_inodecache(void)
                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 = {
        .alloc_inode    = isofs_alloc_inode,
        .destroy_inode  = isofs_destroy_inode,
        .read_inode     = isofs_read_inode,
        .put_super      = isofs_put_super,
        .statfs         = isofs_statfs,
+       .remount_fs     = isofs_remount,
 };
 
 /* the export_operations structure for describing
index c894b7ecac0097b519bd6890053dab54086437bd..aa9dadb489d79801572e5b6f8781e60a8efcd66c 100644 (file)
@@ -149,9 +149,13 @@ static int qnx4_remount(struct super_block *sb, int *flags, char *data)
 
        qs = qnx4_sb(sb);
        qs->Version = QNX4_VERSION;
+#ifndef CONFIG_QNX4FS_RW
+       *flags |= MS_RDONLY;
+#endif
        if (*flags & MS_RDONLY) {
                return 0;
        }
+
        mark_buffer_dirty(qs->sb_buf);
 
        return 0;
index 5d04b8bf6b573e5e432e8867994931d7567d3a01..28c863a2e47e8cb739998da2f7ce07b4693eeedc 100644 (file)
@@ -592,11 +592,18 @@ static void destroy_inodecache(void)
                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 = {
        .alloc_inode    = romfs_alloc_inode,
        .destroy_inode  = romfs_destroy_inode,
        .read_inode     = romfs_read_inode,
        .statfs         = romfs_statfs,
+       .remount_fs     = romfs_remount,
 };
 
 static struct super_block *romfs_get_sb(struct file_system_type *fs_type,