Apparently SEEK_END locking not supported by NFS. Previous variant

returns EINVAL in that case, change it to EOPNOTSUPP.
This commit is contained in:
Andrey A. Chernov 2001-08-23 14:09:16 +00:00
parent b82f5b624c
commit e018907ed4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=82193
2 changed files with 10 additions and 2 deletions

View File

@ -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);

View File

@ -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);