lock status -h [host [-o owner]] [-f file] [-p proto] [-n]
lock status -o [-f file] [-p proto] [-n] (not valid for NLM and NFSv4)
lock status -o owner [-f file] [-p proto] [-n] (CIFS only)
lock status -p protocol [-n]
lock status -n
lock break -f file [-o owner -h host] [-p proto]
lock break -h host [-o owner] [-f file] [-p protocol]
lock break -o owner [-f file] [-p protocol] (CIFS only)
lock break -p protocol
lock break -net network
Note:
Unless a protocol name is specified above, the syntax is valid for all protocols.
Output of lock status -p protocol and lock status -p protocol -f are identical.
Currently, lock break -f file is allowed, but not recommended because breaking NFSv4 locks might lead to unexpected results on the client. The breaking of NFSv4 locks can be prevented by mentioning the protocol along with the file name.
Unlike the case of file name, Host and owner differ in meaning across protocols. Owner is a pertinent filter for CIFS, NLM, and FLEXCACHE only. If protocol is not specified, then locks across all protocols, viz., CIFS, FLEXCACHE, NLM (Nfsv2/Nfsv3), NFSv4, FIO, and WAFL are scanned. In that case, protocols not recognizing the syntax of host or owner generate syntax errors. In the specific cases of NLM and NFSv4, locks cannot be filtered just by specifying owner. Host must be specified along with owner. Owner, being a pid/uid, is not unique unless host (client) is also specified. The same restrictions apply when specifying a set of locks to be broken.
Currently, all protcols filter locks by file, but only
CIFS, NFSv4
and NLM protocols filter locks by host and owner.
NOTE: In the case of NLM, the value of host could be either a hostname (FQDN, hostname alias, etc.,) or an IP address. The lock command does not resolve the hostname to an IP address. Functionally, filtering locks by a hostname is not equivalent to filtering locks by the corresponding IP address. If the locks are to be filtered by host, then the value of host should be obtained from the lock status -h output. Such a value of host should not be interpreted in any way. If done so, may lead to improper status or removal of locks.
An example showing locks grouped by file is:
filer> lock status -f ========0e1d66f7:00000040 state=GRANTED mode=FIO_NoDelete state=GRANTED mode=FIO_NoDelete ========0e1d66f7:00000062 state=GRANTED mode=FIO_NoDelete ========0e1d66f7:000000d3 CIFS path=\word.doc(/vol/vol0/share1/word.doc) host=10.34.17.49(FLOYD-XP) owner=root state=GRANTED mode=Oplock-Excl oplock=Excl ========0e1d66f7:000009d8 state=GRANTED mode=FIO_NoDelete ========0e1d66f7:00000aab CIFS path=\another.doc(/vol/vol0/share2/another.doc) host=10.34.17.49(FLOYD-XP) owner=root state=GRANTED mode=RdWr-denyN oplock=None CIFS path=\another.doc(/vol/vol0/share2/another.doc) host=10.34.17.49(FLOYD-XP) owner=root pid=65279 offset=2147483539 len=1 excl=yes state=GRANTED CIFS path=\another.doc(/vol/vol0/share2/another.doc) host=10.34.17.49(FLOYD-XP) owner=root pid=65279 offset=2147483559 len=1 excl=yes state=GRANTED CIFS path=\another.doc(/vol/vol0/share2/another.doc) host=10.34.17.49(FLOYD-XP) owner=root pid=65279 offset=2147483599 len=1 excl=yes state=GRANTED NLM[zhora.eng.mycompany.com,6892]: 0:0 1 GWAITING (0x61cc5aa0)
As for lock break , there is no way to break locks across all protocols. Locks can be broken for a specified protocol using -p protocol option, though.
CIFS style locks follow the format as shown in the example below:
filer> lock status -p cifs CIFS path=\word.doc(/vol/vol0/share1/word.doc) host=10.34.17.49(FLOYD-XP) owner=root state=GRANTED mode=RdWr-denyN oplock=None fsid=0x0e1d66f7 fileid=0x000000d3 CIFS path=\word.doc(/vol/vol0/share1/word.doc) host=172.18.2.107(VKUMAR-VPC) owner=administrator pid=65279 offset=2147483481 len=1 excl=yes state=GRANTED CIFS path=\word.doc(/vol/vol0/share1/word.doc) host=172.18.2.107(VKUMAR-VPC) owner=administrator state=GRANTED mode=Read-denyN oplock=None fsid=0x0e1d66f7 fileid=0x000000d3 CIFS path=\word.doc(/vol/vol0/share1/word.doc) host=172.18.2.107(VKUMAR-VPC) owner=administrator pid=65279 offset=2147483521 len=1 excl=yes state=GRANTED CIFS path=\word.doc(/vol/vol0/share1/word.doc) host=10.34.17.49(FLOYD-XP) owner=root pid=65279 offset=2147483539 len=1 excl=yes state=GRANTED CIFS path=\word.doc(/vol/vol0/share1/word.doc) host=172.18.2.107(VKUMAR-VPC) owner=administrator pid=65279 offset=2147483540 len=1 excl=yes state=GRANTED CIFS path=\word.doc(/vol/vol0/share1/word.doc) host=10.34.17.49(FLOYD-XP) owner=root pid=65279 offset=2147483559 len=1 excl=yes state=GRANTED CIFS path=\word.doc(/vol/vol0/share1/word.doc) host=10.34.17.49(FLOYD-XP) owner=root pid=65279 offset=2147483599 len=1 excl=yes state=GRANTED CIFS path=\another.doc(/vol/vol0/share2/another.doc) host=10.34.17.49(FLOYD-XP) owner=root state=GRANTED mode=Oplock-Excl oplock=Excl fsid=0x0e1d66f7 fileid=0x00000aab
Locks are described either as share level locks (denoted by the keyword state appearing in the line) or as byte level locks (which have "offset", "len", and "excl" fields). The first line in the example above is a share level lock and has the following format:
Lock record keyed (but not grouped) by host:
filer> lock status -p cifs -h CIFS host=10.34.17.49(FLOYD-XP) owner=root state=GRANTED mode=RdWr-denyN oplock=None fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS host=172.18.2.107(VKUMAR-VPC) owner=administrator state=GRANTED mode=Read-denyN oplock=None fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS host=172.18.2.107(VKUMAR-VPC) owner=administrator pid=65279 offset=2147483481 len=1 excl=yes state=GRANTED fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS host=172.18.2.107(VKUMAR-VPC) owner=administrator pid=65279 offset=2147483521 len=1 excl=yes state=GRANTED fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS host=10.34.17.49(FLOYD-XP) owner=root pid=65279 offset=2147483539 len=1 excl=yes state=GRANTED fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS host=172.18.2.107(VKUMAR-VPC) owner=administrator pid=65279 offset=2147483540 len=1 excl=yes state=GRANTED fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS host=10.34.17.49(FLOYD-XP) owner=root pid=65279 offset=2147483559 len=1 excl=yes state=GRANTED fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS host=10.34.17.49(FLOYD-XP) owner=root pid=65279 offset=2147483599 len=1 excl=yes state=GRANTED fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS host=10.34.17.49(FLOYD-XP) owner=root state=GRANTED mode=Oplock-Excl oplock=Excl fsid=0x0e1d66f7 fileid=0x00000aab path=\another.doc(/vol/vol0/share2/another.doc)
filer> lock status -p cifs -o CIFS owner=root host=10.34.17.49(FLOYD-XP) state=GRANTED mode=RdWr-denyN oplock=None fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS owner=administrator host=172.18.2.107(VKUMAR-VPC) state=GRANTED mode=Read-denyN oplock=None fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS owner=administrator host=172.18.2.107(VKUMAR-VPC) pid=65279 offset=2147483481 len=1 excl=yes state=GRANTED fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS owner=administrator host=172.18.2.107(VKUMAR-VPC) pid=65279 offset=2147483521 len=1 excl=yes state=GRANTED fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS owner=root host=10.34.17.49(FLOYD-XP) pid=65279 offset=2147483539 len=1 excl=yes state=GRANTED fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS owner=administrator host=172.18.2.107(VKUMAR-VPC) pid=65279 offset=2147483540 len=1 excl=yes state=GRANTED fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS owner=root host=10.34.17.49(FLOYD-XP) pid=65279 offset=2147483559 len=1 excl=yes state=GRANTED fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS owner=root host=10.34.17.49(FLOYD-XP) pid=65279 offset=2147483599 len=1 excl=yes state=GRANTED fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS owner=root host=10.34.17.49(FLOYD-XP) state=GRANTED mode=Oplock-Excl oplock=Excl fsid=0x0e1d66f7 fileid=0x00000aab path=\another.doc(/vol/vol0/share2/another.doc)
Lock record filtered by specified NetBIOS host name:
filer> lock status -h vkumar-vpc -p cifs CIFS host=172.18.2.107(VKUMAR-VPC) owner=administrator state=GRANTED mode=Read-denyN oplock=None fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS host=172.18.2.107(VKUMAR-VPC) owner=administrator pid=65279 offset=2147483481 len=1 excl=yes state=GRANTED fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS host=172.18.2.107(VKUMAR-VPC) owner=administrator pid=65279 offset=2147483521 len=1 excl=yes state=GRANTED fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS host=172.18.2.107(VKUMAR-VPC) owner=administrator pid=65279 offset=2147483540 len=1 excl=yes state=GRANTED fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc)
filer> lock status -h 10.34.17.49 -p cifs CIFS host=10.34.17.49(FLOYD-XP) owner=root state=GRANTED mode=RdWr-denyN oplock=None fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS host=10.34.17.49(FLOYD-XP) owner=root pid=65279 offset=2147483539 len=1 excl=yes state=GRANTED fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS host=10.34.17.49(FLOYD-XP) owner=root pid=65279 offset=2147483559 len=1 excl=yes state=GRANTED fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS host=10.34.17.49(FLOYD-XP) owner=root pid=65279 offset=2147483599 len=1 excl=yes state=GRANTED fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS host=10.34.17.49(FLOYD-XP) owner=root state=GRANTED mode=Oplock-Excl oplock=Excl fsid=0x0e1d66f7 fileid=0x00000aab path=\another.doc(/vol/vol0/share2/another.doc)
filer> lock status -o administrator -p cifs CIFS host=172.18.2.107(VKUMAR-VPC) state=GRANTED mode=Read-denyN oplock=None fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS host=172.18.2.107(VKUMAR-VPC) pid=65279 offset=2147483481 len=1 excl=yes state=GRANTED fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS host=172.18.2.107(VKUMAR-VPC) pid=65279 offset=2147483521 len=1 excl=yes state=GRANTED fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc) CIFS host=172.18.2.107(VKUMAR-VPC) pid=65279 offset=2147483540 len=1 excl=yes state=GRANTED fsid=0x0e1d66f7 fileid=0x000000d3 path=\word.doc(/vol/vol0/share1/word.doc)
( NOTE: fileid and fsid fields are replaced by a header: "========0e1d66f7:000000d3", as done in lock status -f command described earlier)
filer> lock status -p cifs -f /vol/vol0/word.doc ========0e1d66f7:000000d3 CIFS path=\word.doc(/vol/vol0/share1/word.doc) host=10.34.17.49(FLOYD-XP) owner=root state=GRANTED mode=RdWr-denyN oplock=None CIFS path=\word.doc(/vol/vol0/share1/word.doc) host=172.18.2.107(VKUMAR-VPC) owner=administrator state=GRANTED mode=Read-denyN oplock=None CIFS path=\word.doc(/vol/vol0/share1/word.doc) host=172.18.2.107(VKUMAR-VPC) owner=administrator pid=65279 offset=2147483481 len=1 excl=yes state=GRANTED CIFS path=\word.doc(/vol/vol0/share1/word.doc) host=172.18.2.107(VKUMAR-VPC) owner=administrator pid=65279 offset=2147483521 len=1 excl=yes state=GRANTED CIFS path=\word.doc(/vol/vol0/share1/word.doc) host=10.34.17.49(FLOYD-XP) owner=root pid=65279 offset=2147483539 len=1 excl=yes state=GRANTED CIFS path=\word.doc(/vol/vol0/share1/word.doc) host=172.18.2.107(VKUMAR-VPC) owner=administrator pid=65279 offset=2147483540 len=1 excl=yes state=GRANTED CIFS path=\word.doc(/vol/vol0/share1/word.doc) host=10.34.17.49(FLOYD-XP) owner=root pid=65279 offset=2147483559 len=1 excl=yes state=GRANTED CIFS path=\word.doc(/vol/vol0/share1/word.doc) host=10.34.17.49(FLOYD-XP) owner=root pid=65279 offset=2147483599 len=1 excl=yes state=GRANTED
filer> lock status -o root -h floyd-xp -p cifs -f /vol/vol0/another.doc CIFS host=10.34.17.49(FLOYD-XP) state=GRANTED mode=Oplock-Excl oplock=Excl fsid=0x0e1d66f7 fileid=0x00000aab path=\another.doc(/vol/vol0/share2/another.doc)
NLM style locks follow the format:
toaster*> lock status -f ========b1000060:0007a88d simcity1775 state=GONE mode=Writ-denyA ========b10000600020e940 simcity1773 00 1 GRANTED (0xbe89ebd8)
The third line is an example of a share level lock on a file:
filer> lock status -f ========4292014d:0000007e NFSv4[IP=172.16.28.73,0]: GRANTED mode=RdWr-denyN (0x7e6a9010,ix=2) NFSv4[IP=172.16.28.73,0]: 0:0 1 GRANTED (0x7e6a8f00,ix=3)
The second line is an example of a share level lock on a file:
State ID index
The third line is an example of a byte level lock on a file:
State ID index
NLM style locks are grouped by host and will show up under this option. They follow the format:
toaster*> lock status -h ========builder 1583 0x00e509e10xb1000060 00 1 GRANTED (0xbe89e8b8) ========simcity 1773 0x0020e9400xb1000060 00 1 GRANTED (0xbe89ebd8) 1775 0x0020e9410xb1000060 state=GONE mode=Writ-denyA
The sixth line in the example above illustrates the format followed by share level locks:
filer> lock status -p NLM -h ======== NLM host darla.lab.mycompany.com 3082 0x3ef4bff6:0x000001cf 0:0 1 GRANTED (0x7ead8ac0) 2988 0x3ef4bff6:0x000001ce 0:0 1 GRANTED (0x7ead88a0) ======== NLM host kendra.lab.mycompany.com 1914 0x3ef4bff6:0x000001cf 0:0 1 GWAITING (0x7ead89b0)
filer> lock status -p NLM -h darla.lab.mycompany.com ======== NLM host darla.lab.mycompany.com 3082 0x3ef4bff6:0x000001cf 0:0 1 GRANTED (0x7ead8ac0) 2988 0x3ef4bff6:0x000001ce 0:0 1 GRANTED (0x7ead88a0)
filer> lock status -p NLM -h darla.lab.mycompany.com -o 3082 ======== NLM host darla.lab.mycompany.com owner 3082 0x3ef4bff6:0x000001cf 0:0 1 GRANTED (0x7ead8ac0)
filer> lock status -h ======== NFSv4 host 172.16.28.73 ========NFSv4 client IP=172.16.28.73 client-id=0x42952fa1/0x00010000 ====== Lock owner: 00000000/0000000B/00001556/07458F08 0 0x4292014d:0x0000007e 0:0 1 GRANTED (0x7e6a8f00,ix=2) ====== Open owner: 00000000/00000028 0 0x4292014d:0x0000007e GRANTED mode=RdWr-denyN (0x7e6a9010,ix=1)
The second line of each dumped set of locks starts with `=' characters and gives the IP address and NFSv4 clientid info of the client which has applied the lock.
The third and fifth line in the example start with `=' characters and gives the NFSv4 owner information of the entity on the client which has applied the lock. Each subset of locks held by a particluar owner will begin with this owner information.
The sixth line in the example above illustrates the format followed by share level locks:
State ID index
The fourth line in the example above illustrates the format followed by share level locks:
State ID index Examples of filtering lock output based on a different parameters are shown below:
Lock records keyed (but not grouped) by host:
filer> lock status -p NFSv4 -h ======== NFSv4 host 172.16.28.73 ========NFSv4 client IP=172.16.28.73 client-id=0x42952fa1/0x00010000 ====== Lock owner: 00000000/0000000B/00001556/07458F08 0 0x4292014d:0x0000007e 0:0 1 GRANTED (0x7e6a8f00,ix=2) ====== Open owner: 00000000/00000028 0 0x4292014d:0x0000007e GRANTED mode=RdWr-denyN (0x7e6a9010,ix=1)
filer> lock status -p NFSv4 -h 172.16.28.73 ======== NFSv4 host 172.16.28.73 0 0x4292014d:0x0000007e 0:0 1 GRANTED (0x7e6a8f00,ix=2) 0 0x4292014d:0x0000007e GRANTED mode=RdWr-denyN (0x7e6a9010,ix=1)
filer> lock status -p NFSv4 -h 172.16.28.73 -o 0 ======== NFSv4 host 172.16.28.73 owner 0 0x4292014d:0x0000007e 0:0 1 GRANTED (0x7e6a8f00,ix=2) 0x4292014d:0x0000007e GRANTED mode=RdWr-denyN (0x7e6a9010,ix=1)
By itself, it will show all of the protocol categories, even if no locks have been issued for that category:
toaster*> lock status -n CIFS 13 share locks, 3 byte locks NLM 1 share locks, 2 byte locks WAFL 0 share locks, 0 byte locks TEST 0 share locks, 0 byte locks
toaster*> lock status -n -h ========simcity NLM 0 share locks, 2 byte locks toaster*> lock status -n -f ========b1000060:00e509e1 NLM: 0 share locks, 1 byte locks ========b1000060:001d0b21 CIFS: 1 share locks, 0 byte locks ========b0000060:00b129be CIFS: 1 share locks, 0 byte locks
lock break -p nlm -h host sub-command breaks all NLM locks for a given host and sends notifications to that host to reclaim its locks.
lock break -p nlm -h host -o owner sub-command breaks all NLM locks for the specified owner on the specified host. No notifications (to reclaim removed locks) are sent.
Note that lock break sub-command does not always require a protocol name. For example, lock break -f file breaks locks across all protocols for the specified file.
The report can be found as a white paper, SecureShare: Guaranteed Multiprotocol File Locking at http://www.netapp.com/tech_library/3024.html.
DelOnClose delete on close semantics
SuperLock used for virus scanning (issued to CIFS clients only)
Deleg-Read In this case, the client is granted the read delegation. When the filer grants a delegation for a file to a client, the client is guaranteed certain privileges with respect to the sharing of that file with other clients. The filer may provide the client either a read or write delegation for the file. If the client is granted a read delegation, it is assured that no other client has the ability to write to the file for the duration of the delegation. RFC 3530 has more details on delegations.
Deleg-Wrt In this case, the client is granted the write delegation. When the filer grants a delegation for a file to a client, the client is guaranteed certain privileges with respect to the sharing of that file with other clients. The filer may provide the client either a read or write delegation for the file. If the client is granted a write delegation, it is assured that no other client has the read or write access to the file for the duration of the delegation. RFC 3530 has more details on delegations.
Access-Deny a combination of the following modes on the lock: