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, 9 insertions, 5 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index cd5900b85d38..1cfeec56df91 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1751,10 +1751,10 @@ static void ubifs_put_super(struct super_block *sb)
1751 ubifs_wbuf_sync(&c->jheads[i].wbuf); 1751 ubifs_wbuf_sync(&c->jheads[i].wbuf);
1752 1752
1753 /* 1753 /*
1754 * On fatal errors c->ro_media is set to 1, in which case we do 1754 * On fatal errors c->ro_error is set to 1, in which case we do
1755 * not write the master node. 1755 * not write the master node.
1756 */ 1756 */
1757 if (!c->ro_media) { 1757 if (!c->ro_error) {
1758 /* 1758 /*
1759 * We are being cleanly unmounted which means the 1759 * We are being cleanly unmounted which means the
1760 * orphans were killed - indicate this in the master 1760 * orphans were killed - indicate this in the master
@@ -1798,16 +1798,20 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data)
1798 } 1798 }
1799 1799
1800 if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) { 1800 if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) {
1801 if (c->ro_error) {
1802 ubifs_msg("cannot re-mount R/W due to prior errors");
1803 return -EROFS;
1804 }
1801 if (c->ro_media) { 1805 if (c->ro_media) {
1802 ubifs_msg("cannot re-mount due to prior errors"); 1806 ubifs_msg("cannot re-mount R/W - UBI volume is R/O");
1803 return -EROFS; 1807 return -EROFS;
1804 } 1808 }
1805 err = ubifs_remount_rw(c); 1809 err = ubifs_remount_rw(c);
1806 if (err) 1810 if (err)
1807 return err; 1811 return err;
1808 } else if (!(sb->s_flags & MS_RDONLY) && (*flags & MS_RDONLY)) { 1812 } else if (!(sb->s_flags & MS_RDONLY) && (*flags & MS_RDONLY)) {
1809 if (c->ro_media) { 1813 if (c->ro_error) {
1810 ubifs_msg("cannot re-mount due to prior errors"); 1814 ubifs_msg("cannot re-mount R/O due to prior errors");
1811 return -EROFS; 1815 return -EROFS;
1812 } 1816 }
1813 ubifs_remount_ro(c); 1817 ubifs_remount_ro(c);