Begign bug: Fix incorrect return value
[yaffs2.git] / yaffs_vfs_multi.c
index a36d9bfaa9d2ba8c21bcf5af02095ab947b07002..3044db72998fa052a08b99be8eb2509c37610ba2 100644 (file)
@@ -2718,6 +2718,7 @@ static int yaffs_sync_fs(struct super_block *sb)
 static int yaffs_remount_fs(struct super_block *sb, int *flags, char *data)
 {
        int read_only = 0;
+       int was_read_only = 0;
        struct mtd_info *mtd;
        struct yaffs_dev *dev = 0;
 
@@ -2747,8 +2748,18 @@ static int yaffs_remount_fs(struct super_block *sb, int *flags, char *data)
        }
 
        dev = sb->s_fs_info;
+       was_read_only = dev->read_only;
        dev->read_only = read_only;
 
+       if (was_read_only && !read_only) {
+               yaffs_gross_lock(dev);
+               yaffs_guts_cleanup(dev);
+               yaffs_gross_unlock(dev);
+               yaffs_bg_start(dev);
+       } else if (!was_read_only && read_only) {
+               yaffs_bg_stop(dev);
+       }
+
        return 0;
 }
 
@@ -3687,6 +3698,7 @@ static struct file_operations procfs_ops = {
        .open  = yaffs_proc_open,
        .read  = seq_read,
        .write = yaffs_proc_write,
+       .release = single_release,
 };
 
 static int yaffs_procfs_init(void)