summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2001-08-23 14:21:26 +0000
committerache <ache@FreeBSD.org>2001-08-23 14:21:26 +0000
commit34f1fd94b4a293b8572295aa2dc4e1facae0ec62 (patch)
treea1083cc57618751b37927051e9a6badf462bc899
parentaafa17c550a577937c77ffc95f0a8fea9cf5c8cb (diff)
downloadFreeBSD-src-34f1fd94b4a293b8572295aa2dc4e1facae0ec62.zip
FreeBSD-src-34f1fd94b4a293b8572295aa2dc4e1facae0ec62.tar.gz
Even better move: suppose that server is able to handle SEEK_END,
so check arguments for all but not SEEK_END case, leaving SEEK_END handling for server
-rw-r--r--sys/nfs/nfs_lock.c12
-rw-r--r--sys/nfsclient/nfs_lock.c12
2 files changed, 12 insertions, 12 deletions
diff --git a/sys/nfs/nfs_lock.c b/sys/nfs/nfs_lock.c
index 4e670f2..ac52410 100644
--- a/sys/nfs/nfs_lock.c
+++ b/sys/nfs/nfs_lock.c
@@ -104,12 +104,12 @@ nfs_dolock(ap)
*/
if (fl->l_len < 0)
return (EINVAL);
- if (fl->l_whence == SEEK_END)
- return (EOPNOTSUPP);
- if (fl->l_start < 0)
- return (EINVAL);
- if (fl->l_len != 0 && (fl->l_len - 1 > OFF_MAX - fl->l_start))
- return (EOVERFLOW);
+ if (fl->l_whence != SEEK_END) {
+ if (fl->l_start < 0)
+ return (EINVAL);
+ if (fl->l_len != 0 && (fl->l_len - 1 > OFF_MAX - fl->l_start))
+ return (EOVERFLOW);
+ }
/*
* Fill in the information structure.
diff --git a/sys/nfsclient/nfs_lock.c b/sys/nfsclient/nfs_lock.c
index 4e670f2..ac52410 100644
--- a/sys/nfsclient/nfs_lock.c
+++ b/sys/nfsclient/nfs_lock.c
@@ -104,12 +104,12 @@ nfs_dolock(ap)
*/
if (fl->l_len < 0)
return (EINVAL);
- if (fl->l_whence == SEEK_END)
- return (EOPNOTSUPP);
- if (fl->l_start < 0)
- return (EINVAL);
- if (fl->l_len != 0 && (fl->l_len - 1 > OFF_MAX - fl->l_start))
- return (EOVERFLOW);
+ if (fl->l_whence != SEEK_END) {
+ if (fl->l_start < 0)
+ return (EINVAL);
+ if (fl->l_len != 0 && (fl->l_len - 1 > OFF_MAX - fl->l_start))
+ return (EOVERFLOW);
+ }
/*
* Fill in the information structure.
OpenPOWER on IntegriCloud