patch-2.4.13 linux/fs/locks.c

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

diff -u --recursive --new-file v2.4.12/linux/fs/locks.c linux/fs/locks.c
@@ -548,7 +548,7 @@
 		return (1);
 
 	default:
-		printk("locks_conflict(): impossible lock type - %d\n",
+		printk(KERN_ERR "locks_conflict(): impossible lock type - %d\n",
 		       caller_fl->fl_type);
 		break;
 	}
@@ -660,7 +660,7 @@
  * from a broken NFS client. But broken NFS clients have a lot more to
  * worry about than proper deadlock detection anyway... --okir
  */
-static int posix_locks_deadlock(struct file_lock *caller_fl,
+int posix_locks_deadlock(struct file_lock *caller_fl,
 				struct file_lock *block_fl)
 {
 	struct list_head *tmp;
@@ -715,6 +715,9 @@
 	struct file_lock *new_fl = locks_alloc_lock(0);
 	int error;
 
+	if (new_fl == NULL)
+		return -ENOMEM;
+
 	new_fl->fl_owner = current->files;
 	new_fl->fl_pid = current->pid;
 	new_fl->fl_file = filp;
@@ -1428,6 +1431,9 @@
 	struct inode *inode;
 	int error;
 
+	if (file_lock == NULL)
+		return -ENOLCK;
+
 	/*
 	 * This might block, so we do it before checking the inode.
 	 */
@@ -1580,6 +1586,9 @@
 	struct flock64 flock;
 	struct inode *inode;
 	int error;
+
+	if (file_lock == NULL)
+		return -ENOLCK;
 
 	/*
 	 * This might block, so we do it before checking the inode.

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