summaryrefslogtreecommitdiffstats
path: root/sys/nfs
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2001-08-23 14:09:16 +0000
committerache <ache@FreeBSD.org>2001-08-23 14:09:16 +0000
commitaafa17c550a577937c77ffc95f0a8fea9cf5c8cb (patch)
treed0c3bea1823b764b83c80aac74cfc53db7b88e3a /sys/nfs
parent29e4dde471102bcfee70455939ab1402b5ecca92 (diff)
downloadFreeBSD-src-aafa17c550a577937c77ffc95f0a8fea9cf5c8cb.zip
FreeBSD-src-aafa17c550a577937c77ffc95f0a8fea9cf5c8cb.tar.gz
Apparently SEEK_END locking not supported by NFS. Previous variant
returns EINVAL in that case, change it to EOPNOTSUPP.
Diffstat (limited to 'sys/nfs')
-rw-r--r--sys/nfs/nfs_lock.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/nfs/nfs_lock.c b/sys/nfs/nfs_lock.c
index cfb8f5a..4e670f2 100644
--- a/sys/nfs/nfs_lock.c
+++ b/sys/nfs/nfs_lock.c
@@ -102,7 +102,11 @@ nfs_dolock(ap)
* the NLM protocol doesn't allow the server to return an error
* on ranges, so we do it.
*/
- if (fl->l_start < 0 || fl->l_len < 0)
+ 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);
OpenPOWER on IntegriCloud