patch-2.4.21 linux-2.4.21/fs/locks.c
Next file: linux-2.4.21/fs/namei.c
Previous file: linux-2.4.21/fs/lockd/svc.c
Back to the patch index
Back to the overall index
- Lines: 21
- Date:
2003-06-13 07:51:37.000000000 -0700
- Orig file:
linux-2.4.20/fs/locks.c
- Orig date:
2002-11-28 15:53:15.000000000 -0800
diff -urN linux-2.4.20/fs/locks.c linux-2.4.21/fs/locks.c
@@ -274,9 +274,18 @@
return -EINVAL;
}
- if (((start += l->l_start) < 0) || (l->l_len < 0))
+ /* POSIX-1996 leaves the case l->l_len < 0 undefined;
+ POSIX-2001 defines it. */
+ start += l->l_start;
+ if (l->l_len < 0) {
+ end = start - 1;
+ start += l->l_len;
+ } else {
+ end = start + l->l_len - 1;
+ }
+
+ if (start < 0)
return -EINVAL;
- end = start + l->l_len - 1;
if (l->l_len > 0 && end < 0)
return -EOVERFLOW;
fl->fl_start = start; /* we record the absolute position */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)