summaryrefslogtreecommitdiffstats
path: root/fs/ubifs/super.c
diff options
context:
space:
mode:
authorAdrian Hunter2009-01-29 11:59:33 +0100
committerArtem Bityutskiy2009-01-29 15:19:36 +0100
commitb466f17d780c5b72427f36aef22ecdec9f1d0689 (patch)
tree09346513db7a7563f9a79ec0e6ec56b8536fabe9 /fs/ubifs/super.c
parentUBIFS: spelling fix 'date' -> 'data' (diff)
downloadkernel-qcow2-linux-b466f17d780c5b72427f36aef22ecdec9f1d0689.tar.gz
kernel-qcow2-linux-b466f17d780c5b72427f36aef22ecdec9f1d0689.tar.xz
kernel-qcow2-linux-b466f17d780c5b72427f36aef22ecdec9f1d0689.zip
UBIFS: remount ro fixes
- preserve the idx_gc list - it will be needed in the same state, should UBIFS be remounted rw again - prevent remounting ro if we have switched to read only mode (due to a fatal error) Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/super.c')
-rw-r--r--fs/ubifs/super.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 3ddd754262b4..daa679d3a03e 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1687,10 +1687,6 @@ static void ubifs_remount_ro(struct ubifs_info *c)
if (err)
ubifs_ro_mode(c, err);
- err = ubifs_destroy_idx_gc(c);
- if (err)
- ubifs_ro_mode(c, err);
-
free_wbufs(c);
vfree(c->orph_buf);
c->orph_buf = NULL;
@@ -1793,15 +1789,19 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data)
if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) {
if (c->ro_media) {
- ubifs_msg("cannot re-mount R/W, UBIFS is working in "
- "R/O mode");
+ ubifs_msg("cannot re-mount due to prior errors");
return -EINVAL;
}
err = ubifs_remount_rw(c);
if (err)
return err;
- } else if (!(sb->s_flags & MS_RDONLY) && (*flags & MS_RDONLY))
+ } else if (!(sb->s_flags & MS_RDONLY) && (*flags & MS_RDONLY)) {
+ if (c->ro_media) {
+ ubifs_msg("cannot re-mount due to prior errors");
+ return -EINVAL;
+ }
ubifs_remount_ro(c);
+ }
if (c->bulk_read == 1)
bu_init(c);