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
This commit is contained in:
parent
e018907ed4
commit
6c3f4fef64
sys
@ -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.
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user