Bug 5979 - Level 2 oplocks being granted improperly
Summary: Level 2 oplocks being granted improperly
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.2
Classification: Unclassified
Component: File services (show other bugs)
Version: unspecified
Hardware: Other All
: P3 normal
Target Milestone: ---
Assignee: Jeremy Allison
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-17 19:18 UTC by Jeremy Allison
Modified: 2012-09-10 20:49 UTC (History)
0 users

See Also:


Attachments
Patch (104 bytes, patch)
2008-12-17 19:26 UTC, Jeremy Allison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Allison 2008-12-17 19:18:01 UTC
Hello,
I am reading the oplock granting code in samba 3.0.32 And I have a
question, if I may.

It seems to me that if someone is asking for an exclusive lock or level
two oplock when all other share lock owners of the files don't have any
oplock (not even a fake level two)  he will be granted a level two
oplock.
But if one of the other clients will perform a write operation or
anything else, he wont notify the level oplock 2 holder on the async
oplock break needed.

I have checked samba . 3.0.20, and it seems no oplock is granted in that
case in the old version.

I think there are two possibilities for a solution, send everyone else a
request two make  fake level two oplock upgrade or just deny the oplock
request from the client.
I have a patch for the second suggestion.

Am I right ?

Thanks,
Itay dar
Itay.dar@exanet.com

P.s
The relevant code is in delay_for_oplocks function inside smbd/open.c
Comment 1 Jeremy Allison 2008-12-17 19:18:32 UTC
Confirmed this bug still applies to 3.2.x and above.
Jeremy.
Comment 2 Jeremy Allison 2008-12-17 19:26:32 UTC
Created attachment 3815 [details]
Patch

Patch for 3.2.x and above.
Jeremy.
Comment 3 Björn Jacke 2009-02-11 04:09:38 UTC
Jeremy, the attached thing doesn't look like a patch. Is this bug still valid or is there already a fix pushed?
Comment 4 Jeremy Allison 2012-09-10 20:49:38 UTC
Was fixed (incorrectly) with git id 1a5fc6d4bc847d9896500b704c9a8d5ac7faa7d2.