From: liaohua <
liaohua4@huawei.com>
If the dev is remounted ro, no checkpoint data is saved.
And that will increase the time for next mount.
Signed-off-by: liaohua <
liaohua4@huawei.com>
---
yaffs_vfs_multi.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/yaffs_vfs_multi.c b/yaffs_vfs_multi.c
index 3044db7..5956a24 100644
--- a/yaffs_vfs_multi.c
+++ b/yaffs_vfs_multi.c
@@ -2749,14 +2749,20 @@ 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);
+ dev->read_only = read_only;
+ yaffs_bg_enable = 1;
yaffs_guts_cleanup(dev);
yaffs_gross_unlock(dev);
yaffs_bg_start(dev);
} else if (!was_read_only && read_only) {
+ yaffs_gross_lock(dev);
+ yaffs_bg_enable = 0;
+ yaffs_flush_super(sb, 1);
+ dev->read_only = read_only;
+ yaffs_gross_unlock(dev);
yaffs_bg_stop(dev);
}
--
2.26.2.windows.1