]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Add cond_resched_lock() fix from Jan Kara (fwd'd from Andrew)
authorChris Wright <chrisw@osdl.org>
Mon, 13 Jun 2005 17:13:55 +0000 (10:13 -0700)
committerChris Wright <chrisw@osdl.org>
Mon, 13 Jun 2005 17:13:55 +0000 (10:13 -0700)
queue/cond_resched_lock-fix.patch [new file with mode: 0644]
queue/series [new file with mode: 0644]

diff --git a/queue/cond_resched_lock-fix.patch b/queue/cond_resched_lock-fix.patch
new file mode 100644 (file)
index 0000000..d9f1406
--- /dev/null
@@ -0,0 +1,53 @@
+From stable-bounces@linux.kernel.org  Mon Jun 13 15:56:08 2005
+Date: Mon, 13 Jun 2005 15:56:36 -0700
+From: Andrew Morton <akpm@osdl.org>
+To: stable@kernel.org
+Cc: akpm@osdl.org, jack@suse.cz, mingo@elte.hu
+Subject: [PATCH] cond_resched_lock() fix
+
+
+From: Jan Kara <jack@suse.cz>
+
+On one path, cond_resched_lock() fails to return true if it dropped the lock. 
+We think this might be causing the crashes in JBD's log_do_checkpoint().
+
+Cc: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Andrew Morton <akpm@osdl.org>
+Signed-off-by: Chris Wright <chrisw@osdl.org>
+---
+
+ kernel/sched.c |    7 +++++--
+ 1 files changed, 5 insertions(+), 2 deletions(-)
+
+Index: release-2.6.11/kernel/sched.c
+===================================================================
+--- release-2.6.11.orig/kernel/sched.c
++++ release-2.6.11/kernel/sched.c
+@@ -3788,11 +3788,14 @@ EXPORT_SYMBOL(cond_resched);
+  */
+ int cond_resched_lock(spinlock_t * lock)
+ {
++      int ret = 0;
++
+ #if defined(CONFIG_SMP) && defined(CONFIG_PREEMPT)
+       if (lock->break_lock) {
+               lock->break_lock = 0;
+               spin_unlock(lock);
+               cpu_relax();
++              ret = 1;
+               spin_lock(lock);
+       }
+ #endif
+@@ -3800,10 +3803,10 @@ int cond_resched_lock(spinlock_t * lock)
+               _raw_spin_unlock(lock);
+               preempt_enable_no_resched();
+               __cond_resched();
++              ret = 1;
+               spin_lock(lock);
+-              return 1;
+       }
+-      return 0;
++      return ret;
+ }
+ EXPORT_SYMBOL(cond_resched_lock);
diff --git a/queue/series b/queue/series
new file mode 100644 (file)
index 0000000..c44fe7c
--- /dev/null
@@ -0,0 +1 @@
+cond_resched_lock-fix.patch