PowerScale: OneFS: How to disable opportunistic locking (Oplock) on SMB file shares
Summary: An article going over how to disable Oplocks for use with SMB protocol on a OneFS cluster.
Instructions
Introduction
In the Server Messenger Block (SMB) protocol, opportunistic locking (Oplock) is a file locking mechanism that is designed to increase network performance and reduce network use. When Oplocks is enabled on the cluster, clients can buffer file data locally. This reduces network traffic when working with a file stored on a network share. For more information about Oplocks, see File System Behavior in the Microsoft Windows Environment (embedded link on page, refer to Section 2, "Oplock Semantics" in the PDF provided).
Some applications, including older versions of Microsoft Excel and Microsoft Access, do not function correctly if Oplocks is enabled on SMB network shares. Also, the performance of some network concentrators can be negatively impacted by Oplocks. A network concentrator is a remote access hub that provides bridging, routing, and data transmission services for a network.
If an application is incompatible with Oplocks, you might experience one or more of the following issues:
- When you try to open a file from the network share, the file might take longer than expected to open.
- A file that you opened over the network is opened as read-only.
- You receive various error messages that a sharing violation has occurred when you open or close a file that is saved on the network share.
This article provides procedures for disabling Oplocks using the OneFS web administration interface or the command line.
Procedures
You can disable Oplocks from the OneFS web administration interface or from the command line.
IMPORTANT!
Network traffic between the client and the cluster might increase slightly if Oplocks is disabled.
Use the OneFS web administration interface for share-specific changes:
- Click Protocols > Windows Sharing (SMB) > SMB Shares tab.
- Click View details for a specific share.
- Click Advanced SMB Share Settings > Performance Settings.
- In the Oplocks drop-down menu, change the value to Use custom.
- When prompted by the warning message, click Continue, and you can choose Yes or No to force the change.
Use the OneFS web administration interface for global changes:
- Click Protocols > Windows Sharing (SMB) > SMB Settings tab.
- Expand SMB Share Settings and then Performance Settings.
- In the Oplocks drop-down menu, change the value to Use custom.
- When prompted by the warning message, click Continue, and you can choose Yes or No to force the change.
Use the command line:
- Open an SSH connection on any node in the cluster and log in using the "root" account.
- Run the following command to disable Oplocks for all shares:
isi smb settings shares modify --oplocks=false - Run the following command to enable Oplocks for all shares:
isi smb settings shares modify --oplocks=true
SMB clients must disconnect and reconnect in order for the changes to take effect.