diff options
Diffstat (limited to 'fs/ubifs/super.c')
-rw-r--r-- | fs/ubifs/super.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 522c3fd7eb3c..3589eab02a2f 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/mount.h> | 36 | #include <linux/mount.h> |
37 | #include <linux/math64.h> | 37 | #include <linux/math64.h> |
38 | #include <linux/writeback.h> | 38 | #include <linux/writeback.h> |
39 | #include <linux/smp_lock.h> | ||
39 | #include "ubifs.h" | 40 | #include "ubifs.h" |
40 | 41 | ||
41 | /* | 42 | /* |
@@ -1770,17 +1771,22 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data) | |||
1770 | return err; | 1771 | return err; |
1771 | } | 1772 | } |
1772 | 1773 | ||
1774 | lock_kernel(); | ||
1773 | if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) { | 1775 | if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) { |
1774 | if (c->ro_media) { | 1776 | if (c->ro_media) { |
1775 | ubifs_msg("cannot re-mount due to prior errors"); | 1777 | ubifs_msg("cannot re-mount due to prior errors"); |
1778 | unlock_kernel(); | ||
1776 | return -EROFS; | 1779 | return -EROFS; |
1777 | } | 1780 | } |
1778 | err = ubifs_remount_rw(c); | 1781 | err = ubifs_remount_rw(c); |
1779 | if (err) | 1782 | if (err) { |
1783 | unlock_kernel(); | ||
1780 | return err; | 1784 | return err; |
1785 | } | ||
1781 | } else if (!(sb->s_flags & MS_RDONLY) && (*flags & MS_RDONLY)) { | 1786 | } else if (!(sb->s_flags & MS_RDONLY) && (*flags & MS_RDONLY)) { |
1782 | if (c->ro_media) { | 1787 | if (c->ro_media) { |
1783 | ubifs_msg("cannot re-mount due to prior errors"); | 1788 | ubifs_msg("cannot re-mount due to prior errors"); |
1789 | unlock_kernel(); | ||
1784 | return -EROFS; | 1790 | return -EROFS; |
1785 | } | 1791 | } |
1786 | ubifs_remount_ro(c); | 1792 | ubifs_remount_ro(c); |
@@ -1795,6 +1801,7 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data) | |||
1795 | } | 1801 | } |
1796 | 1802 | ||
1797 | ubifs_assert(c->lst.taken_empty_lebs > 0); | 1803 | ubifs_assert(c->lst.taken_empty_lebs > 0); |
1804 | unlock_kernel(); | ||
1798 | return 0; | 1805 | return 0; |
1799 | } | 1806 | } |
1800 | 1807 | ||