Skip to content

Commit f6140a8

Browse files
dedekindgregkh
authored andcommitted
JFFS2: fix unmount regression
commit a445f78 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>
1 parent 8c63c3b commit f6140a8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/jffs2/super.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ static int jffs2_sync_fs(struct super_block *sb, int wait)
100100
{
101101
struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);
102102

103+
#ifdef CONFIG_JFFS2_FS_WRITEBUFFER
104+
cancel_delayed_work_sync(&c->wbuf_dwork);
105+
#endif
106+
103107
mutex_lock(&c->alloc_sem);
104108
jffs2_flush_wbuf_pad(c);
105109
mutex_unlock(&c->alloc_sem);

0 commit comments

Comments
 (0)