Skip to main content

Enable or disable oplocks on existing SMB shares

Contributors netapp-ahibbard netapp-thomi

Oplocks are enabled on SMB shares on storage virtual machines (SVMs) by default. Under some circumstances, you might want to disable oplocks; alternatively, if you have previously disabled oplocks on a share, you might want to reenable oplocks.

About this task

If oplocks are enabled on the volume containing a share, but the oplock share property for that share is disabled, oplocks are disabled for that share. Disabling oplocks on a share takes precedence over enabling oplocks on the volume. Disabling oplocks on the share, disables both opportunistic and lease oplocks. You can enable or disable oplocks on existing shares at any time.

Step
  1. Perform the applicable action:

    If you want to…​ Then…​

    Enable oplocks on a share by modifying an existing share

    Enter the following command: vserver cifs share properties add -vserver vserver_name -share-name share_name -share-properties oplocks

    Note

    You can specify additional share properties to add by using a comma-delimited list.

    Newly added properties are appended to the existing list of share properties. Any share properties that you have previously specified remain in effect.

    Disable oplocks on a share by modifying an existing share

    Enter the following command: vserver cifs share properties remove -vserver vserver_name -share-name share_name -share-properties oplocks

    Note

    You can specify additional share properties to remove by using a comma-delimited list.

    Share properties that you remove are deleted from the existing list of share properties; however, previously configured share properties that you do not remove remain in effect.

Examples

The following command enables oplocks for the share named “Engineering” on storage virtual machine (SVM, formerly known as Vserver) vs1:

cluster1::> vserver cifs share properties add -vserver vs1 -share-name Engineering -share-properties oplocks

cluster1::> vserver cifs share properties show
Vserver          Share            Properties
---------------- ---------------- -----------------
vs1              Engineering      oplocks
                                  browsable
                                  changenotify
                                  showsnapshot

The following command disables oplocks for the share named “Engineering” on SVM vs1:

cluster1::> vserver cifs share properties remove -vserver vs1 -share-name Engineering -share-properties oplocks

cluster1::> vserver cifs share properties show
Vserver          Share            Properties
---------------- ---------------- -----------------
vs1              Engineering      browsable
                                  changenotify
                                  showsnapshot