patch-2.2.14 linux/fs/locks.c

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

diff -u --recursive --new-file v2.2.13/linux/fs/locks.c linux/fs/locks.c
@@ -688,8 +688,11 @@
 
 	if (((start += l->l_start) < 0) || (l->l_len < 0))
 		return (0);
+	fl->fl_end = start + l->l_len - 1;
+	if (l->l_len > 0 && fl->fl_end < 0)
+		return (0);
 	fl->fl_start = start;	/* we record the absolute position */
-	if ((l->l_len == 0) || ((fl->fl_end = start + l->l_len - 1) < 0))
+	if (l->l_len == 0)
 		fl->fl_end = OFFSET_MAX;
 	
 	fl->fl_file = filp;

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