oplocks causing more trouble than benefit ?

Marcello Romani mromani at ottotecnica.com
Tue Nov 7 12:42:57 GMT 2006

Hi everybody,
     my setup is 1 fileserver running samba 3.0.22 on Gentoo Linux, and
15-20 clients, some of which are XP and some W2K.

On some PCs we have Outlook 2000, and we store each user's outlook.pst
file in a private folder on the fileserver.

One of the W2K clients had hardware problems that caused it to freeze
once in a while.
Everytime this happened, the user would restart the machine and
everything was fine, except Outlook complained it could not open the
personal folders file because it was already in use by another user (or
process, I don't remember the error message exactly).

smbstatus showed in fact that the smbd process the user was connected to
_before_ her PC freezed was still holding a DENY_WRITE lock on the
outlook.pst file.

One solution was to manually kill that smbd process. While this worked
almost every time (although it was really annoying because that PC's
hardware failures were becoming frequent), one day I had to restart smbd
entirely (or was it the entire server ?).

To make a long story short, I searched the docs and finally found that
the problem was I had oplocks enabled in the smb.conf file. Disabling it
solved the issue entirely.
The conf file now reads something like:

     (snip other options)
     oplocks = no

While trying to solve this issue I've read quite some docs about the
oplocks feature, and it seems to me that while they may improve
performance, they are very complicated and rely on a not so robust
I didn't notice any slowdown after disabling oplocks, but this might be
because our network and fileserver are usually underloaded.

So my question is: why are oplocks on by default ? Wouldn't it be safer 
(and more trouble-free) to turn them off by default and specify under 
which circumstances they might give the performance improvements that 
justify their adoption ?

Thanks in advance.

Marcello Romani
Responsabile IT
Ottotecnica s.r.l.

More information about the samba-technical mailing list