lock: address differences in lock semantics

zero-length ranges: valid on windows, but nfs servers MUST return NFS4ERR_INVAL for LOCK with length=0. use MRxIsLockRealizable() to return STATUS_NOT_SUPPORTED for zero-length ranges (avoiding the lock upcall and rpc)

ranges that extend past UINT64_MAX: not valid on windows. NFS expects length=UINT64_MAX for locking to end-of-file. use length=UINT64_MAX if length >= UINT64_MAX-offset (making lock ranges consistent with linux client)

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2011-06-13 12:02:59 -04:00
parent 2d252266c2
commit d98da23d49
3 changed files with 18 additions and 2 deletions

View file

@ -4404,6 +4404,11 @@ NTSTATUS nfs41_IsLockRealizable (
ByteOffset->QuadPart,Length->QuadPart,
BooleanFlagOn(LowIoLockFlags, SL_EXCLUSIVE_LOCK),
!BooleanFlagOn(LowIoLockFlags, SL_FAIL_IMMEDIATELY));
/* NFS lock operations with length=0 MUST fail with NFS4ERR_INVAL */
if (Length->QuadPart == 0)
status = STATUS_NOT_SUPPORTED;
DbgEx();
return status;
}