patch-2.3.15 linux/fs/locks.c

Next file: linux/fs/namei.c
Previous file: linux/fs/lockd/svclock.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.14/linux/fs/locks.c linux/fs/locks.c
@@ -193,6 +193,14 @@
 {
 	struct file_lock *prevblock;
 
+	if (waiter->fl_prevblock) {
+		printk(KERN_ERR "locks_insert_block: remove duplicated lock "
+			"(pid=%d %ld-%ld type=%d)\n",
+			waiter->fl_pid, waiter->fl_start,
+			waiter->fl_end, waiter->fl_type);
+		locks_delete_block(waiter->fl_prevblock, waiter);
+	}
+
 	if (blocker->fl_prevblock == NULL)
 		/* No previous waiters - list is empty */
 		prevblock = blocker;
@@ -282,7 +290,7 @@
 /* flock() system call entry point. Apply a FL_FLOCK style lock to
  * an open file descriptor.
  */
-asmlinkage int sys_flock(unsigned int fd, unsigned int cmd)
+asmlinkage long sys_flock(unsigned int fd, unsigned int cmd)
 {
 	struct file_lock file_lock;
 	struct file *filp;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)