patch-2.2.19 linux/fs/locks.c
Next file: linux/fs/nfs/dir.c
Previous file: linux/fs/lockd/svcsubs.c
Back to the patch index
Back to the overall index
-  Lines: 29
-  Date:
Sun Mar 25 11:37:38 2001
-  Orig file: 
v2.2.18/fs/locks.c
-  Orig date: 
Sun Mar 25 11:28:33 2001
diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.18/fs/locks.c linux/fs/locks.c
@@ -268,20 +268,22 @@
 
 	while ((waiter = blocker->fl_nextblock) != NULL) {
 		/* N.B. Is it possible for the notify function to block?? */
+		if (!wait) {
+			/* Remove waiter from the block list, because by the
+			 * time it wakes up blocker won't exist any more.
+			 */
+			locks_delete_block(blocker, waiter);
+		}
 		if (waiter->fl_notify)
 			waiter->fl_notify(waiter);
-		wake_up(&waiter->fl_wait);
+		else
+			wake_up(&waiter->fl_wait);
 		if (wait) {
 			/* Let the blocked process remove waiter from the
 			 * block list when it gets scheduled.
 			 */
 			current->policy |= SCHED_YIELD;
 			schedule();
-		} else {
-			/* Remove waiter from the block list, because by the
-			 * time it wakes up blocker won't exist any more.
-			 */
-			locks_delete_block(blocker, waiter);
 		}
 	}
 	return;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)