file locks across threads

From: Anton Blanchard (anton@linuxcare.com)
Date: Tue May 30 2000 - 12:21:00 EST


Hi,

If we share a files struct we dont share the locks.

Why isnt the patch below sufficient for testing the owner?

Cheers,
Anton

--- linux_sparc32/fs/locks.c Fri Apr 21 17:45:17 2000
+++ linux/fs/locks.c Tue May 30 10:08:33 2000
@@ -171,14 +171,11 @@
 
 /*
  * Check whether two locks have the same owner
- * N.B. Do we need the test on PID as well as owner?
- * (Clone tasks should be considered as one "owner".)
  */
 static inline int
 locks_same_owner(struct file_lock *fl1, struct file_lock *fl2)
 {
- return (fl1->fl_owner == fl2->fl_owner) &&
- (fl1->fl_pid == fl2->fl_pid);
+ return (fl1->fl_owner == fl2->fl_owner);
 }
 
 /* Insert waiter into blocker's block list.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:25 EST