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.

Related Posts

Netfilter – iptables on Debian

To create and save iptables rules the default Debian way, this is the...

Athlon Powersavings on Debian

This article was first written in January 2005 for the BeezNest technical website...