Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6df3cecb authored by Jan Kara's avatar Jan Kara Committed by Linus Torvalds
Browse files

[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: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f797f9cc
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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);