]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
JFFS2: fix unmount regression
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Thu, 23 Aug 2012 07:10:07 +0000 (10:10 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Oct 2012 20:50:34 +0000 (05:50 +0900)
commit a445f784ae5558a3da680aa6b39ed53c95a551c1 upstream.

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@atmel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/jffs2/super.c

index 61ea41389f90d91d8b3ab6a6a39cd580720f1950..1224d6b48e7e5270830928e323da026a7fe33c41 100644 (file)
@@ -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);