diff -urpNX dontdiff linux-2.5.43/fs/locks.c linux-2.5.43-flock/fs/locks.c
--- linux-2.5.43/fs/locks.c	2002-09-27 20:10:43.000000000 -0700
+++ linux-2.5.43-flock/fs/locks.c	2002-10-10 18:03:10.000000000 -0700
@@ -727,12 +726,16 @@ static int flock_lock_file(struct file *
 	}
 	unlock_kernel();
 
-	if (found)
-		yield();
-
 	if (new_fl->fl_type == F_UNLCK)
 		return 0;
 
+	/*
+	 * If a higher-priority process was blocked on the old file lock,
+	 * give it the opportunity to lock the file.
+	 */
+	if (found)
+		cond_resched();
+
 	lock_kernel();
 	for_each_lock(inode, before) {
 		struct file_lock *fl = *before;
