Unable to delete or rename files due to lock present on the file
Applies to
- ONTAP 9
- CIFS/SMB
- CIFS locks
Issue
Access denied
or similar errors when accessing or attempting to rename or delete a file or folder in ONTAP- User unable to delete file:
- File disappears and reappears when refreshing windows explorer
- "
Cannot delete file because it is open by the system
" error
- Deleting the file in System Manager fails:
You do not have permission to close this activity
- Sectrace output shows:
::> vserver security trace trace-result show Vserver: svm_1
Node Index Filter Details Reason
--------------- ----- -------------------------- ------------------------------
Node-01 1 Security Style: - Access is denied because a
delete is pending on this
object
Protocol: cifs
Volume: -
Share: share1
Path: /example/test/test.file
Win-User: domain\user
UNIX-User: root
Session-ID: xxxxxxxxxxxxxx
- ONTAP command
vserver locks show
indicates a client maintaining a lock on the affected file
Example:
::> vserver locks show
Vserver: vs0
Volume Object Path LIF Protocol Lock Type Client
-------- ------------------------- ----------- --------- ----------- ----------
vol1 /vol1/notes.txt node1_data1
cifs share-level 192.168.1.5
Sharelock Mode: read_write-deny_delete
op-lock 192.168.1.5
Oplock Level: read-batch