Consider:
lock = start=110,size=10
pend_lock = 100, size=10
Do not overlap. However,
(lock->start <= pend_lock->start + pend_lock->size)
110 100 10
is true, so it returns true (overlap).
lock->start <= pend_lock->start + pend_lock->size
should be:
lock->start < pend_lock->start + pend_lock->size
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10685
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Jul 2 10:18:17 CEST 2014 on sn-devel-104
{
if ((lock->start <= pend_lock->start) && (lock->start + lock->size > pend_lock->start))
return True;
{
if ((lock->start <= pend_lock->start) && (lock->start + lock->size > pend_lock->start))
return True;
- if ((lock->start >= pend_lock->start) && (lock->start <= pend_lock->start + pend_lock->size))
+ if ((lock->start >= pend_lock->start) && (lock->start < pend_lock->start + pend_lock->size))
return True;
return False;
}
return True;
return False;
}