All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] compat: fix system crash on 2.6.35 when flushing work
@ 2012-07-13  8:38 Zefir Kurtisi
  2012-07-18 15:24 ` Luis R. Rodriguez
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Zefir Kurtisi @ 2012-07-13  8:38 UTC (permalink / raw)
  To: mcgrof; +Cc: lf_driver_backport, linux-wireless, linux-bluetooth, Zefir Kurtisi

Ubuntu 10.10 stock kernel (2.6.35-22-generic) crashes in
compat_flush_scheduled_work(), that is called e.g. when
mac80211 module is unloaded.

The problem was introduced with 80bf8a83
compat: backport system work queues system_wq and system_long_wq

The crash happens in compat_flush_scheduled_work() where both
flush_workqueue() and flush_scheduled_work() are called successively.
Removing one of them resolves the issue.

All compat-wireless tarballs after 2012-03-18 are affected.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
---
 compat/compat-2.6.36.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/compat/compat-2.6.36.c b/compat/compat-2.6.36.c
index 9190ecd..8f25be0 100644
--- a/compat/compat-2.6.36.c
+++ b/compat/compat-2.6.36.c
@@ -140,7 +140,6 @@ void compat_flush_scheduled_work(void)
 	 * go with the old kernel's one first for now (keventd_wq) and
 	 * if think its reasonable later we can flip this around.
 	 */
-	flush_workqueue(system_wq);
 	flush_scheduled_work();
 }
 EXPORT_SYMBOL_GPL(compat_flush_scheduled_work);
-- 
1.7.4.1


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

* Re: [PATCH] compat: fix system crash on 2.6.35 when flushing work
  2012-07-13  8:38 [PATCH] compat: fix system crash on 2.6.35 when flushing work Zefir Kurtisi
@ 2012-07-18 15:24 ` Luis R. Rodriguez
  2012-08-07 17:47 ` Luis R. Rodriguez
  2012-08-12 16:19 ` C. McPherson
  2 siblings, 0 replies; 5+ messages in thread
From: Luis R. Rodriguez @ 2012-07-18 15:24 UTC (permalink / raw)
  To: Zefir Kurtisi; +Cc: mcgrof, lf_driver_backport, linux-wireless, linux-bluetooth

On Fri, Jul 13, 2012 at 1:38 AM, Zefir Kurtisi
<zefir.kurtisi@neratec.com> wrote:
> Ubuntu 10.10 stock kernel (2.6.35-22-generic) crashes in
> compat_flush_scheduled_work(), that is called e.g. when
> mac80211 module is unloaded.
>
> The problem was introduced with 80bf8a83
> compat: backport system work queues system_wq and system_long_wq
>
> The crash happens in compat_flush_scheduled_work() where both
> flush_workqueue() and flush_scheduled_work() are called successively.
> Removing one of them resolves the issue.
>
> All compat-wireless tarballs after 2012-03-18 are affected.
>
> Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>

Thanks! Applied and pushed and I'll roll this into the stable series
as well and make a new set of releases where this is applicable today.

  Luis

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

* Re: [PATCH] compat: fix system crash on 2.6.35 when flushing work
  2012-07-13  8:38 [PATCH] compat: fix system crash on 2.6.35 when flushing work Zefir Kurtisi
  2012-07-18 15:24 ` Luis R. Rodriguez
@ 2012-08-07 17:47 ` Luis R. Rodriguez
  2012-08-12 16:19 ` C. McPherson
  2 siblings, 0 replies; 5+ messages in thread
From: Luis R. Rodriguez @ 2012-08-07 17:47 UTC (permalink / raw)
  To: Zefir Kurtisi; +Cc: mcgrof, lf_driver_backport, linux-wireless, linux-bluetooth

On Fri, Jul 13, 2012 at 10:38:34AM +0200, Zefir Kurtisi wrote:
> Ubuntu 10.10 stock kernel (2.6.35-22-generic) crashes in
> compat_flush_scheduled_work(), that is called e.g. when
> mac80211 module is unloaded.
> 
> The problem was introduced with 80bf8a83
> compat: backport system work queues system_wq and system_long_wq
> 
> The crash happens in compat_flush_scheduled_work() where both
> flush_workqueue() and flush_scheduled_work() are called successively.
> Removing one of them resolves the issue.
> 
> All compat-wireless tarballs after 2012-03-18 are affected.
> 
> Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
> ---
>  compat/compat-2.6.36.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/compat/compat-2.6.36.c b/compat/compat-2.6.36.c
> index 9190ecd..8f25be0 100644
> --- a/compat/compat-2.6.36.c
> +++ b/compat/compat-2.6.36.c
> @@ -140,7 +140,6 @@ void compat_flush_scheduled_work(void)
>  	 * go with the old kernel's one first for now (keventd_wq) and
>  	 * if think its reasonable later we can flip this around.
>  	 */
> -	flush_workqueue(system_wq);
>  	flush_scheduled_work();
>  }
>  EXPORT_SYMBOL_GPL(compat_flush_scheduled_work);

I've reverted this in favor for Hauke's fix. Although he did not revert
your patch after inspecing his change it was apparant that the endless
loop was really the issue. The backported fix is on the linux-3.5.y
branch and the backported patch does a bit more justice to review
the fix. I've load / unload tested this on v2.6.35.

I kicked out a new v3.5 release based on this, the -3 release.

>From 5ea4da5f1e96fc1aba89b62290f0aaab0e943b0a Mon Sep 17 00:00:00 2001
From: "Luis R. Rodriguez" <mcgrof@frijolero.org>
Date: Tue, 7 Aug 2012 09:19:08 -0700
Subject: [PATCH] compat: revert 4595ae7579bf17 (upstream 3da0495c)

This reverts the commit:

commit 4595ae7579bf177150d7a661644c852f7d549bfa
Author: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Date:   Fri Jul 13 10:38:34 2012 +0200

    compat: fix system crash on 2.6.35 when flushing work

    Upstream commit 3da0495cf863288b6798e121ccf93c4453c6c768

    Ubuntu 10.10 stock kernel (2.6.35-22-generic) crashes in
    compat_flush_scheduled_work(), that is called e.g. when
    mac80211 module is unloaded.

    The problem was introduced with 80bf8a83
    compat: backport system work queues system_wq and system_long_wq

    The crash happens in compat_flush_scheduled_work() where both
    flush_workqueue() and flush_scheduled_work() are called successively.
    Removing one of them resolves the issue.

    All compat-wireless tarballs after 2012-03-18 are affected.

    Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
    Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>

And then applies the 2 upstream commits:

>From 78fda91b330657f1d66afc32d18cae99f4783f21 Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Thu, 2 Aug 2012 18:28:01 +0200

    compat: fix endless recursion in flush_scheduled_work

    The hader file defines flush_scheduled_work(a)
    compat_flush_scheduled_work(a), which causes flush_scheduled_work() and
    compat_flush_scheduled_work() to be the same function.

    With this patch it calls the actual function in the kernel.

    This fixes problems when unloading mac80211 from compat-wireless.

    Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
    Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>

>From 19041dd7befe97f476c187bc15442cd738c67f37 Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Tue, 7 Aug 2012 00:36:20 +0200

    compat: fix undef syntax

   Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
   Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>

The real fix was to avoid the recursive call to
flush_scheduled_work() by undef'ing it on the c
file.

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
---
 compat/compat-2.6.36.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/compat/compat-2.6.36.c b/compat/compat-2.6.36.c
index 8f25be0..72ada4a 100644
--- a/compat/compat-2.6.36.c
+++ b/compat/compat-2.6.36.c
@@ -133,6 +133,7 @@ int compat_schedule_delayed_work_on(int cpu,
 }
 EXPORT_SYMBOL_GPL(compat_schedule_delayed_work_on);
 
+#undef flush_scheduled_work
 void compat_flush_scheduled_work(void)
 {
 	/*
@@ -140,6 +141,7 @@ void compat_flush_scheduled_work(void)
 	 * go with the old kernel's one first for now (keventd_wq) and
 	 * if think its reasonable later we can flip this around.
 	 */
+	flush_workqueue(system_wq);
 	flush_scheduled_work();
 }
 EXPORT_SYMBOL_GPL(compat_flush_scheduled_work);
-- 
1.7.10.4


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

* Re: [PATCH] compat: fix system crash on 2.6.35 when flushing work
  2012-07-13  8:38 [PATCH] compat: fix system crash on 2.6.35 when flushing work Zefir Kurtisi
  2012-07-18 15:24 ` Luis R. Rodriguez
  2012-08-07 17:47 ` Luis R. Rodriguez
@ 2012-08-12 16:19 ` C. McPherson
  2012-08-13 11:15   ` Zefir Kurtisi
  2 siblings, 1 reply; 5+ messages in thread
From: C. McPherson @ 2012-08-12 16:19 UTC (permalink / raw)
  To: Zefir Kurtisi; +Cc: mcgrof, lf_driver_backport, linux-wireless, linux-bluetooth

Zefir:
Thanks a lot for this reference. All my systems are running Ubuntu 
10.04/10.10. I was updating our compat-wireless with the stable 
compat-wireless 3.5
and came across this crash in our testing lab. I added your patch and 
the stable compat-wireless 3.5 is now working with our Ubuntu.

-Tex


On 07/13/2012 04:38 AM, Zefir Kurtisi wrote:
> Ubuntu 10.10 stock kernel (2.6.35-22-generic) crashes in
> compat_flush_scheduled_work(), that is called e.g. when
> mac80211 module is unloaded.
>
> The problem was introduced with 80bf8a83
> compat: backport system work queues system_wq and system_long_wq
>
> The crash happens in compat_flush_scheduled_work() where both
> flush_workqueue() and flush_scheduled_work() are called successively.
> Removing one of them resolves the issue.
>
> All compat-wireless tarballs after 2012-03-18 are affected.
>
> Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
> ---
>   compat/compat-2.6.36.c |    1 -
>   1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/compat/compat-2.6.36.c b/compat/compat-2.6.36.c
> index 9190ecd..8f25be0 100644
> --- a/compat/compat-2.6.36.c
> +++ b/compat/compat-2.6.36.c
> @@ -140,7 +140,6 @@ void compat_flush_scheduled_work(void)
>   	 * go with the old kernel's one first for now (keventd_wq) and
>   	 * if think its reasonable later we can flip this around.
>   	 */
> -	flush_workqueue(system_wq);
>   	flush_scheduled_work();
>   }
>   EXPORT_SYMBOL_GPL(compat_flush_scheduled_work);


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

* Re: [PATCH] compat: fix system crash on 2.6.35 when flushing work
  2012-08-12 16:19 ` C. McPherson
@ 2012-08-13 11:15   ` Zefir Kurtisi
  0 siblings, 0 replies; 5+ messages in thread
From: Zefir Kurtisi @ 2012-08-13 11:15 UTC (permalink / raw)
  To: C. McPherson; +Cc: mcgrof, lf_driver_backport, linux-wireless, linux-bluetooth

On 08/12/2012 06:19 PM, C. McPherson wrote:
> Zefir:
> Thanks a lot for this reference. All my systems are running Ubuntu
> 10.04/10.10. I was updating our compat-wireless with the stable
> compat-wireless 3.5
> and came across this crash in our testing lab. I added your patch and
> the stable compat-wireless 3.5 is now working with our Ubuntu.
> 
> -Tex
> 
> 
Hi Tex,

the fix Hauke provided is the correct one. The QH I posted was a lucky
punch that for some reason prevented the system crashing without
resolving the issue.



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

end of thread, other threads:[~2012-08-13 11:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-13  8:38 [PATCH] compat: fix system crash on 2.6.35 when flushing work Zefir Kurtisi
2012-07-18 15:24 ` Luis R. Rodriguez
2012-08-07 17:47 ` Luis R. Rodriguez
2012-08-12 16:19 ` C. McPherson
2012-08-13 11:15   ` Zefir Kurtisi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.