Level II Oplocks and Snow Leopard Server Samba

| No Comments | No TrackBacks

If you do a testparm on your /etc/smb.conf file on Mac OS X Server 10.6, there's a good chance you'll see this message:

Level II oplocks can only be set if oplocks are also set.

You can read about "level2" or "level 2" opportunistic locking here in the official Samba HOWTO document (though it's written for v3.2 and Apple ships 3.0, I find it's almost entirely compatible and, in the least, quite informative). Here is what the document says,

Level2 Oplocks provides opportunistic locking for a file that will be treated as read only. Typically this is used on files that are read-only or on files that the client has no initial intention to write to at time of opening the file.

Level 2 oplocks appear to be something set to "true" or "on" by default. While Server Admin allows for enabling (plain old) oplocks and strict oplocks, there's no interface for setting level 2 oplocks off. But as the message indicates, it's effectively disabled without enabling locking in the first place.

If you do enable oplocks via Server Admin, and find the need to not have level 2 oplocks enabled too (for some odd reason — perhaps you're neurotically conscientious of your testparm output) you will need to specify this option explicitly on the share realm, not the global realm. 

Hand-edit your /etc/smb.conf file, following the convention indicated by Apple (that is, make your changes at the bottom of the conf file, using [My Sharepoint] instead of [global], setting

level2 oplocks = no [or false, if you prefer]

For example,

; Site-specific parameters can be added below this comment.
; END required configuration.

[global]
    realm = stanford.edu
    acl check permissions = no
    nt acl support = no 
    veto files = /Thumbs.db/.DS_Store/.TemporaryItems/TheVolumeSettingsFolder/TheFindByContentFolder/Temporary Items/Network Trash Folder/        

[Projects]
    path = /Shares/Projects     
    acl check permissions = no 
    nt acl support = no
    level2 oplocks = no

Remember that Apple recommends using oplocks only on shares accessed via SMB only.

No TrackBacks

TrackBack URL: http://www.stanford.edu/group/macosxsig/cgi-bin/mt/mt-tb.cgi/91

Leave a comment

About this Entry

This page contains a single entry by Noah Abrahamson published on January 26, 2010 11:28 AM.

Snow Leopard's Samba adds unwanted directives to shares was the previous entry in this blog.

Chassis lock on Xserve prevents bootup is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.