aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/super.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-03-29 02:45:21 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-04-05 03:45:09 -0400
commitc88ac00c5af70c2a0741da14b22cdcf8507ddd92 (patch)
tree5561ff6e47406f58e71eda4700c5a3f2694c6f71 /fs/ubifs/super.c
parent54acbaaa523ca0bd284a18f67ad213c379679e86 (diff)
UBIFS: fix assertion warnings
This patch fixes UBIFS assertion warnings like: UBIFS assert failed in ubifs_leb_unmap at 135 (pid 29365) Pid: 29365, comm: integck Tainted: G I 2.6.37-ubi-2.6+ #34 Call Trace: [<ffffffffa047c663>] ubifs_lpt_init+0x95e/0x9ee [ubifs] [<ffffffffa04623a7>] ubifs_remount_fs+0x2c7/0x762 [ubifs] [<ffffffff810f066e>] do_remount_sb+0xb6/0x101 [<ffffffff81106ff4>] ? do_mount+0x191/0x78e [<ffffffff811070bb>] do_mount+0x258/0x78e [<ffffffff810da1e8>] ? alloc_pages_current+0xa2/0xc5 [<ffffffff81107674>] sys_mount+0x83/0xbd [<ffffffff81009a12>] system_call_fastpath+0x16/0x1b They happen when we re-mount from R/O mode to R/W mode. While re-mounting, we write to the media, but we still have the c->ro_mount flag set. The fix is very simple - just clear the flag before starting re-mounting R/W. These warnings are caused by the following commit: 2ef13294d29bcfb306e0d360f1b97f37b647b0c0 For -stable guys: this bug was introduced in 2.6.38, this is materieal for 2.6.38-stable. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Cc: stable@kernel.org [2.6.38]
Diffstat (limited to 'fs/ubifs/super.c')
-rw-r--r--fs/ubifs/super.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 6ddd9973e681..c75f6133206c 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1568,6 +1568,7 @@ static int ubifs_remount_rw(struct ubifs_info *c)
1568 mutex_lock(&c->umount_mutex); 1568 mutex_lock(&c->umount_mutex);
1569 dbg_save_space_info(c); 1569 dbg_save_space_info(c);
1570 c->remounting_rw = 1; 1570 c->remounting_rw = 1;
1571 c->ro_mount = 0;
1571 1572
1572 err = check_free_space(c); 1573 err = check_free_space(c);
1573 if (err) 1574 if (err)
@@ -1676,13 +1677,13 @@ static int ubifs_remount_rw(struct ubifs_info *c)
1676 } 1677 }
1677 1678
1678 dbg_gen("re-mounted read-write"); 1679 dbg_gen("re-mounted read-write");
1679 c->ro_mount = 0;
1680 c->remounting_rw = 0; 1680 c->remounting_rw = 0;
1681 err = dbg_check_space_info(c); 1681 err = dbg_check_space_info(c);
1682 mutex_unlock(&c->umount_mutex); 1682 mutex_unlock(&c->umount_mutex);
1683 return err; 1683 return err;
1684 1684
1685out: 1685out:
1686 c->ro_mount = 1;
1686 vfree(c->orph_buf); 1687 vfree(c->orph_buf);
1687 c->orph_buf = NULL; 1688 c->orph_buf = NULL;
1688 if (c->bgt) { 1689 if (c->bgt) {