diff options
author | Jan Kara <jack@suse.cz> | 2005-06-14 00:52:32 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-14 05:58:58 +0200 |
commit | 6df3cecbb95345981718b38d357c50bc3425420a (patch) | |
tree | 50550e3863513ac051164abc082e2899d61d4dab /kernel | |
parent | [PATCH] Fix PCI BAR size interpretation on 64-bit arches (diff) | |
download | linux-6df3cecbb95345981718b38d357c50bc3425420a.tar.xz linux-6df3cecbb95345981718b38d357c50bc3425420a.zip |
[PATCH] cond_resched_lock() fix
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: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 66b2ed784822..f12a0c8a7d98 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -3755,19 +3755,22 @@ EXPORT_SYMBOL(cond_resched); */ int cond_resched_lock(spinlock_t * lock) { + int ret = 0; + if (need_lockbreak(lock)) { spin_unlock(lock); cpu_relax(); + ret = 1; spin_lock(lock); } if (need_resched()) { _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); |