From 1a5fc6d4bc847d9896500b704c9a8d5ac7faa7d2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 17 Dec 2008 17:23:13 -0800 Subject: Fix bug #5979 - Level 2 oplocks being granted improperly, Jeremy. --- source3/locking/locking.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'source3/locking/locking.c') diff --git a/source3/locking/locking.c b/source3/locking/locking.c index a70f9d20fe..b342fa9b1e 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -1186,7 +1186,16 @@ bool remove_share_oplock(struct share_mode_lock *lck, files_struct *fsp) } e->op_mid = 0; - e->op_type = NO_OPLOCK; + if (EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type)) { + /* + * Going from exclusive or batch, + * we always go through FAKE_LEVEL_II + * first. + */ + e->op_type = FAKE_LEVEL_II_OPLOCK; + } else { + e->op_type = NO_OPLOCK; + } lck->modified = True; return True; } -- cgit