aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/super.c
diff options
context:
space:
mode:
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)
1687 if (err) 1687 if (err)
1688 ubifs_ro_mode(c, err); 1688 ubifs_ro_mode(c, err);
1689 1689
1690 err = ubifs_destroy_idx_gc(c);
1691 if (err)
1692 ubifs_ro_mode(c, err);
1693
1694 free_wbufs(c); 1690 free_wbufs(c);
1695 vfree(c->orph_buf); 1691 vfree(c->orph_buf);
1696 c->orph_buf = NULL; 1692 c->orph_buf = NULL;
@@ -1793,15 +1789,19 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data)
1793 1789
1794 if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) { 1790 if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) {
1795 if (c->ro_media) { 1791 if (c->ro_media) {
1796 ubifs_msg("cannot re-mount R/W, UBIFS is working in " 1792 ubifs_msg("cannot re-mount due to prior errors");
1797 "R/O mode");
1798 return -EINVAL; 1793 return -EINVAL;
1799 } 1794 }
1800 err = ubifs_remount_rw(c); 1795 err = ubifs_remount_rw(c);
1801 if (err) 1796 if (err)
1802 return err; 1797 return err;
1803 } else if (!(sb->s_flags & MS_RDONLY) && (*flags & MS_RDONLY)) 1798 } else if (!(sb->s_flags & MS_RDONLY) && (*flags & MS_RDONLY)) {
1799 if (c->ro_media) {
1800 ubifs_msg("cannot re-mount due to prior errors");
1801 return -EINVAL;
1802 }
1804 ubifs_remount_ro(c); 1803 ubifs_remount_ro(c);
1804 }
1805 1805
1806 if (c->bulk_read == 1) 1806 if (c->bulk_read == 1)
1807 bu_init(c); 1807 bu_init(c);