linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: JFFS2 issue with v3.5.x and later on Atmel chips at least (was: Kernel oops since v3.5.x on Atmel chips)
       [not found] ` <5034F3F8.9080802@atmel.com>
@ 2012-08-23  6:35   ` Artem Bityutskiy
  2012-08-23  7:41   ` Artem Bityutskiy
  1 sibling, 0 replies; 3+ messages in thread
From: Artem Bityutskiy @ 2012-08-23  6:35 UTC (permalink / raw)
  To: ludovic.desroches
  Cc: Linux Kernel list, linux-arm-kernel, linux-mtd,
	Jean-Christophe PLAGNIOL-VILLARD, Nicolas Ferre

[-- Attachment #1: Type: text/plain, Size: 429 bytes --]

On Wed, 2012-08-22 at 17:00 +0200, ludovic.desroches wrote:
> After bisection the commit causing this issue is:
> 
> commit 8bdc81c5069e43755d6e59e5e990e21ca200e8e2
> Author: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
> Date:   Mon May 7 19:56:53 2012 +0300
> 
>      jffs2: get rid of jffs2_sync_super

Thanks Ludovic for bisecting the issue, I'll take a look at this.

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: JFFS2 issue with v3.5.x and later on Atmel chips at least (was: Kernel oops since v3.5.x on Atmel chips)
       [not found] ` <5034F3F8.9080802@atmel.com>
  2012-08-23  6:35   ` JFFS2 issue with v3.5.x and later on Atmel chips at least (was: Kernel oops since v3.5.x on Atmel chips) Artem Bityutskiy
@ 2012-08-23  7:41   ` Artem Bityutskiy
       [not found]     ` <5035F266.2040909@atmel.com>
  1 sibling, 1 reply; 3+ messages in thread
From: Artem Bityutskiy @ 2012-08-23  7:41 UTC (permalink / raw)
  To: ludovic.desroches
  Cc: Linux Kernel list, linux-arm-kernel, linux-mtd,
	Jean-Christophe PLAGNIOL-VILLARD, Nicolas Ferre


[-- Attachment #1.1: Type: text/plain, Size: 1534 bytes --]

From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
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 <ludovic.desroches@atmel.com>
Cc: stable@vger.kernel.org [3.5+]
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
---

Ludovic, would you please give this patch a test? Also attached.

 fs/jffs2/super.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
index 61ea413..e385fa3 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -100,6 +100,9 @@ static int jffs2_sync_fs(struct super_block *sb, int wait)
 {
 	struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);
 
+	if (IS_ENABLED(CONFIG_JFFS2_FS_WRITEBUFFER))
+		cancel_delayed_work_sync(&c->wbuf_dwork);
+
 	mutex_lock(&c->alloc_sem);
 	jffs2_flush_wbuf_pad(c);
 	mutex_unlock(&c->alloc_sem);
-- 
1.7.10.4

[-- Attachment #1.2: 0001-JFFS2-fix-unmount-regression.patch --]
[-- Type: text/x-patch, Size: 1538 bytes --]

From 2f1554d01f7db58631f9da7dd19a7254d1096feb Mon Sep 17 00:00:00 2001
From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
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 <ludovic.desroches@atmel.com>
Cc: stable@vger.kernel.org [3.5+]
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
---
 fs/jffs2/super.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
index 61ea413..e385fa3 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -100,6 +100,9 @@ static int jffs2_sync_fs(struct super_block *sb, int wait)
 {
 	struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);
 
+	if (IS_ENABLED(CONFIG_JFFS2_FS_WRITEBUFFER))
+		cancel_delayed_work_sync(&c->wbuf_dwork);
+
 	mutex_lock(&c->alloc_sem);
 	jffs2_flush_wbuf_pad(c);
 	mutex_unlock(&c->alloc_sem);
-- 
1.7.10.4


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: JFFS2 issue with v3.5.x and later on Atmel chips at least
       [not found]     ` <5035F266.2040909@atmel.com>
@ 2012-08-23 12:37       ` Artem Bityutskiy
  0 siblings, 0 replies; 3+ messages in thread
From: Artem Bityutskiy @ 2012-08-23 12:37 UTC (permalink / raw)
  To: ludovic.desroches
  Cc: Nicolas Ferre, Linux Kernel list, linux-mtd,
	Jean-Christophe PLAGNIOL-VILLARD, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 1798 bytes --]

On Thu, 2012-08-23 at 11:05 +0200, ludovic.desroches wrote:
> 
> Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com> 

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

From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
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 <ludovic.desroches@atmel.com>
Cc: stable@vger.kernel.org [3.5+]
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>
---
 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);
 
+#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);
-- 
1.7.10.4


-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-23 12:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <5034B45A.5060107@atmel.com>
     [not found] ` <5034F3F8.9080802@atmel.com>
2012-08-23  6:35   ` JFFS2 issue with v3.5.x and later on Atmel chips at least (was: Kernel oops since v3.5.x on Atmel chips) Artem Bityutskiy
2012-08-23  7:41   ` Artem Bityutskiy
     [not found]     ` <5035F266.2040909@atmel.com>
2012-08-23 12:37       ` JFFS2 issue with v3.5.x and later on Atmel chips at least Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).