diff options
author | Zack Kirsch <zack.kirsch@isilon.com> | 2009-02-20 15:22:15 -0800 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2009-02-20 16:42:50 -0800 |
commit | a04bb5f9a267c6945db6ff25e16d15f7f813aaaf (patch) | |
tree | 05b6ed05b94b16341fa0407ea6928a517fc2898f /source3/locking | |
parent | 5300dc62888dfd36479353f4a6ea5cb52728c754 (diff) | |
download | samba-a04bb5f9a267c6945db6ff25e16d15f7f813aaaf.tar.gz samba-a04bb5f9a267c6945db6ff25e16d15f7f813aaaf.tar.bz2 samba-a04bb5f9a267c6945db6ff25e16d15f7f813aaaf.zip |
s3 BRL: Add more clarifying comments and add implied logic to make conditional more clear
Diffstat (limited to 'source3/locking')
-rw-r--r-- | source3/locking/brlock.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c index d12c4affc3..aa522ac780 100644 --- a/source3/locking/brlock.c +++ b/source3/locking/brlock.c @@ -74,6 +74,7 @@ bool brl_same_context(const struct lock_context *ctx1, static bool brl_overlap(const struct lock_struct *lck1, const struct lock_struct *lck2) { + /* XXX Remove for Win7 compatibility. */ /* this extra check is not redundent - it copes with locks that go beyond the end of 64 bit file space */ if (lck1->size != 0 && @@ -105,8 +106,11 @@ static bool brl_conflict(const struct lock_struct *lck1, return False; } - if (brl_same_context(&lck1->context, &lck2->context) && - lck2->lock_type == READ_LOCK && lck1->fnum == lck2->fnum) { + /* A READ lock can stack on top of a WRITE lock if they have the same + * context & fnum. */ + if (lck1->lock_type == WRITE_LOCK && lck2->lock_type == READ_LOCK && + brl_same_context(&lck1->context, &lck2->context) && + lck1->fnum == lck2->fnum) { return False; } |