aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-10-18 01:32:35 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-10-21 04:15:18 -0400
commit3601ba27353a968df843454e4b81155376682505 (patch)
tree144263a6c1d1255f260788da3d8f5593e2ad6bb4 /fs
parent39037559e651c417fb68b828926dc61cd5d6e5e2 (diff)
UBIFS: do not forget to cancel timers
This is a bug-fix: when we unmount, and we are currently in R/O mode because of an error - we do not sync write-buffers, which means we also do not cancel write-buffer timers we may possibly have armed. This patch fixes the issue. The issue can easily be reproduced by enabling UBIFS failure debug mode (echo 4 > /sys/module/ubifs/parameters/debug_tsts) and unmounting as soon as a failure happen. At some point the system oopses because we have an armed hrtimer but UBIFS is unmounted already. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ubifs/super.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 6ff2f802bd7e..9a47c9f0ad07 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1772,6 +1772,10 @@ static void ubifs_put_super(struct super_block *sb)
1772 */ 1772 */
1773 ubifs_err("failed to write master node, " 1773 ubifs_err("failed to write master node, "
1774 "error %d", err); 1774 "error %d", err);
1775 } else {
1776 for (i = 0; i < c->jhead_cnt; i++)
1777 /* Make sure write-buffer timers are canceled */
1778 hrtimer_cancel(&c->jheads[i].wbuf.timer);
1775 } 1779 }
1776 } 1780 }
1777 1781