From: Chris Wright Date: Mon, 13 Jun 2005 17:13:55 +0000 (-0700) Subject: Add cond_resched_lock() fix from Jan Kara (fwd'd from Andrew) X-Git-Tag: v2.6.12.1~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5204ef459ad760d5ccf2e491b924baadeedc72ca;p=thirdparty%2Fkernel%2Fstable-queue.git Add cond_resched_lock() fix from Jan Kara (fwd'd from Andrew) --- diff --git a/queue/cond_resched_lock-fix.patch b/queue/cond_resched_lock-fix.patch new file mode 100644 index 00000000000..d9f1406c2ff --- /dev/null +++ b/queue/cond_resched_lock-fix.patch @@ -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 +To: stable@kernel.org +Cc: akpm@osdl.org, jack@suse.cz, mingo@elte.hu +Subject: [PATCH] cond_resched_lock() fix + + +From: Jan Kara + +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 +Signed-off-by: Andrew Morton +Signed-off-by: Chris Wright +--- + + 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 index 00000000000..c44fe7cb654 --- /dev/null +++ b/queue/series @@ -0,0 +1 @@ +cond_resched_lock-fix.patch