Patchwork JFFS2 issue with v3.5.x and later on Atmel chips at least

mail settings
Submitter Artem Bityutskiy
Date Aug. 23, 2012, 12:37 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/179622/
State New, archived
Headers show


Artem Bityutskiy - Aug. 23, 2012, 12:37 p.m.
On Thu, 2012-08-23 at 11:05 +0200, ludovic.desroches wrote:
> Tested-by: Ludovic Desroches <> 

Thanks, pushed to l2-mtd.git tree a bit modified patch. Will ping dwmw2
about merging it to Linus.

From: Artem Bityutskiy <>
Date: Thu, 23 Aug 2012 10:10:07 +0300
Subject: [PATCH] JFFS2: fix unmount regression

This patch fixes regression introduced by
"8bdc81c jffs2: get rid of jffs2_sync_super". We submit a delayed work in order
to make sure the write-buffer is synchronized at some point. But we do not
flush it when we unmount, which causes an oops when we unmount the file-system
and then the delayed work is executed.

This patch fixes the issue by adding a "cancel_delayed_work_sync()" infocation
in the '->sync_fs()' handler. This will make sure the delayed work is canceled
on sync, unmount and re-mount. And because VFS always callse 'sync_fs()' before
unmounting or remounting, this fixes the issue.

Reported-by: Ludovic Desroches <>
Cc: [3.5+]
Signed-off-by: Artem Bityutskiy <>
Tested-by: Ludovic Desroches <>
 fs/jffs2/super.c |    4 ++++
 1 file changed, 4 insertions(+)


diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
index 61ea413..1224d6b 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -100,6 +100,10 @@  static int jffs2_sync_fs(struct super_block *sb, int wait)
 	struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);
+	cancel_delayed_work_sync(&c->wbuf_dwork);