Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[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>

authored by

Jan Kara and committed by
Linus Torvalds
6df3cecb f797f9cc

+5 -2
+5 -2
kernel/sched.c
··· 3755 3755 */ 3756 3756 int cond_resched_lock(spinlock_t * lock) 3757 3757 { 3758 + int ret = 0; 3759 + 3758 3760 if (need_lockbreak(lock)) { 3759 3761 spin_unlock(lock); 3760 3762 cpu_relax(); 3763 + ret = 1; 3761 3764 spin_lock(lock); 3762 3765 } 3763 3766 if (need_resched()) { 3764 3767 _raw_spin_unlock(lock); 3765 3768 preempt_enable_no_resched(); 3766 3769 __cond_resched(); 3770 + ret = 1; 3767 3771 spin_lock(lock); 3768 - return 1; 3769 3772 } 3770 - return 0; 3773 + return ret; 3771 3774 } 3772 3775 3773 3776 EXPORT_SYMBOL(cond_resched_lock);