HOWTO Activate kernel oplocks in Samba on Debian GNU/Linux (up to Sarge)

This article was first written in February 2006 for the BeezNest technical
website (

Starting from kernel 2.4, Linux has got the kernel oplocks feature. Kernel oplocks would permit Samba to share locks with the UNIX filesystem, to allow local Linux applications or applications accessing the files through NFS for example to be notified of files already opened for writing by a client using SMB.

Sadly, the Samba package in Debian GNU/Linux up to Sarge disable this feature to keep compatibility with kernels strictly inferior to 2.4.

To activate it, you then have to rebuild the package, after commenting the lines disabling this feature in the file debian/config.cache of the package sources. Those following lines are the ones to comment:


Commenting the next lines would probably allow you to enable even more features.

It's only fair to share...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on TumblrEmail this to someone

Leave a Reply

Your email address will not be published. Required fields are marked *