ONTAP 9 Manuals ( CA08871-402 )

Enable or disable oplocks when creating SMB shares

Oplocks allow clients to lock files and cache content locally, which can increase performance for file operations. Oplocks are enabled on SMB shares residing on storage virtual machines (SVMs). In some circumstances, you might want to disable oplocks. You can enable or disable oplocks on a share-by-share basis.

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 the volume oplock setting. Disabling oplocks on the share disables both opportunistic and lease oplocks.

You can specify other share properties in addition to specifying the oplock share property by using a comma-delimited list. You can also specify other share parameters.

Steps
  1. Perform the applicable action:

    If you want to…​ Then…​

    Enable oplocks on a share during share creation

    Enter the following command: vserver cifs share create -vserver _vserver_name_ -share-name share_name -path path_to_share -share-properties [oplocks,...]

    If you want the share to have only the default share properties, which are oplocks, browsable, and changenotify enabled, you do not have to specify the -share-properties parameter when creating an SMB share. If you want any combination of share properties other than the default, then you must specify the -share-properties parameter with the list of share properties to use for that share.

    Disable oplocks on a share during share creation

    Enter the following command: vserver cifs share create -vserver _vserver_name_ -share-name _share_name_ -path _path_to_share_ -share-properties [other_share_property,...]

    When disabling oplocks, you must specify a list of share properties when creating the share, but you should not specify the oplocks property.

Top of Page