JFFS2: fix unmount regression
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Sat Sep 29 10:59:06 EDT 2012
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=a445f784ae5558a3da680aa6b39ed53c95a551c1
Commit: a445f784ae5558a3da680aa6b39ed53c95a551c1
Parent: b05a1187bbf35035300313987cbd22e362d71dc6
Author: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
AuthorDate: Thu Aug 23 10:10:07 2012 +0300
Committer: David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Sat Sep 29 14:58:42 2012 +0100
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 <ludovic.desroches at atmel.com>
Cc: stable at vger.kernel.org [3.5+]
Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
Tested-by: Ludovic Desroches <ludovic.desroches at atmel.com>
Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
fs/jffs2/super.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
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);
+#ifdef CONFIG_JFFS2_FS_WRITEBUFFER
+ cancel_delayed_work_sync(&c->wbuf_dwork);
+#endif
+
mutex_lock(&c->alloc_sem);
jffs2_flush_wbuf_pad(c);
mutex_unlock(&c->alloc_sem);
More information about the linux-mtd-cvs
mailing list