samba 3.6.9-164 - is "kernel oplocks = no" option viable on purely Samba shared FS?

Karel Lang AFD lang at
Mon Sep 22 15:37:03 MDT 2014

Hi Ira,
thanks for kind reply. Actually i don't want want to remove 'oplocks' 
option as it is as you say enabling the file caching at client side an 
as such speeds things over the LAN (as far as i understand it)

Jeremy Allison already confirmed the 'kernel oplocks' option (which 
takes care about linux level locking) is still Global option 

So i plan on my shares, that are purely Samba Fileserver FSs turn the 
'kernel oplocks' to 'no' (because no unix processes access those FS) and 
keep 'oplocks' on (as it is enabled by default anyway).

Thank you for mentioning to me those level2 oplocks, i'll have to study 
those to more detail!

Karel Lang

On 09/22/2014 05:00 PM, Ira Cooper wrote:
> kernel oplocks = no will not disable all oplocks, it disables the use of
> kernel oplocks, which should allow for the use of (IMHO) Samba's internal
> oplocks which are superior, if you are using the share just for SMB.
> If you want to disable oplocks, I believe you want: oplocks = no .
> You may also want to look at enabling level2 oplocks. (With: level2 oplocks
> = yes )
> As far as consistency goes: Oplocks are an optimization.  They are actually
> to allow client side caching of data.  Removing them should not have a
> negative impact on correctness.  (If anything it should be better.)
> Thanks,
> -Ira
> On Mon, Sep 22, 2014 at 12:32 AM, Karel Lang AFD <lang at> wrote:
>> Hi,
>> anyone tried to speed up samba file transfer over the network by turning
>> off the kernel opportunity locking - the so called:
>> "kernel oplocks = no" on production server, if yes, were the results safe
>> enough (in regards of data consistency)?
>> 2 questions:
>> 1.
>> In scenario, where you have purely data storage filesystem (no apps, no
>> databases anything), shared only over Samba and accessed by windows client
>> workstations - would it be OK to use the "kernel oplocks = no" option?
>> 2.
>> is the "kernel oplocks = no" still Global option??
>> it used to be a global option, but i read somewhere that devs wanted to
>> code it as 'Share' option - which would be great for testing ..
>> I'm asking this because i found out some 2years old discussion from list,
>> where Christian Ambach was doing something about it. But i can't find more
>> 'fresh' info and official 'Samba 3 howto' documentations lists the 'kernel
>> oplocks' as 'Global' option..
>> I tried to post this question to regular 'general' samba forums, but as
>> noone replied there, i figgured this could be the right place to ask ..
>> thank you

More information about the samba-technical mailing list