Originally posted by: Brazen
A very niche application (CAD software) requires block level access to the files, and an object level sharing protocol like SMB will not cut it.2. Better to mount the drive on a single box and share it out so that SMB oplocks can handle contention.
Bullshit.
Frame taken from a capture with a block locked (oplocks otherwise disabled ... this capture is taken from a misconfigured/broken box that I was fixing yesterday)
638 07:33:27.216 000D2925167F 000BCD41907B SMB C lock & X, FID = 0x4004, Unlocks = 1 (0x00000000 for 0xFFFFFFFFFFFFFFFF) (xxxDeletedforPrivacyxxx) IP
FRAME: Base frame properties
FRAME: Time of capture = 8/30/2006 7:33:27 AM
FRAME: Time delta from previous physical frame: 31250 microseconds
FRAME: Frame number: 638
FRAME: Total frame length: 129 bytes
FRAME: Capture frame length: 129 bytes
FRAME: Frame data: Number of data bytes remaining = 129 (0x0081)
ETHERNET: EType = Internet IP (IPv4)
ETHERNET: Destination address = xxxDeletedforPrivacyxxx
ETHERNET: 0....... = Individual address
ETHERNET: .0...... = Universally administered address
ETHERNET: Source address = xxxDeletedforPrivacyxxx
ETHERNET: .0...... = Universally administered address
ETHERNET: Ethernet Type : 0x0800 (Internet IP (IPv4))
IP: Protocol = TCP - Transmission Control; Packet ID = 3895; Total IP Length = 115; Options = No Options
IP: Version = IPv4; Header Length = 20
IP: 0100.... = IP Version 4
IP: ....0101 = Header Length 20
IP: Type of Service = Normal Service
IP: 000..... = Precedence - Routine
IP: ...0.... = Normal Delay
IP: ....0... = Normal Throughput
IP: .....0.. = Normal Reliability
IP: ......0. = Normal Monetary Cost
IP: Total Length = 115 (0x73)
IP: Identification = 3895 (0xF37)
IP: Fragmentation Summary = 16384 (0x4000)
IP: .1.............. = Cannot fragment datagram
IP: ..0............. = Last fragment in datagram
IP: ...0000000000000 = Fragment Offset 0 (0x0000)
IP: Time to Live = 126 (0x7E)
IP: Protocol = TCP - Transmission Control
IP: Checksum = 32259 (0x7E03)
IP: Source Address = xxxDeletedforPrivacyxxx
IP: Destination Address = xxxDeletedforPrivacyxxx
TCP: Control Bits: .AP..., len: 75, seq:1026511329-1026511404, ack:3788195647, win:33103, src: 1150 dst: 445
TCP: Source Port = 0x047E
TCP: Destination Port = Microsoft-DS
TCP: Sequence Number = 1026511329 (0x3D2F51E1)
TCP: Acknowledgement Number = 3788195647 (0xE1CB473F)
TCP: Data Offset = 20 bytes
TCP: 0101.... = Data Offset (20 bytes)
TCP: ....0000 = Reserved bits
TCP: Flags = 0x18 : .AP...
TCP: ..0..... = No urgent data
TCP: ...1.... = Acknowledgement field significant
TCP: ....1... = Push function
TCP: .....0.. = No Reset
TCP: ......0. = No Synchronize
TCP: .......0 = Not the end of the data
TCP: Window = 33103 (0x814F)
TCP: Checksum = 0x17ED
TCP: Urgent Pointer = 0 (0x0)
NBT: SS: Session Message, Len: 71
NBT: Packet Type = Session Message
NBT: Packet Flags = 0 (0x0)
NBT: .......0 = Add 0 to Length
NBT: Packet Length = 71 (0x47)
NBT: SS Data: Number of data bytes remaining = 71 (0x0047)
SMB: C lock & X, FID = 0x4004, Unlocks = 1 (0x00000000 for 0xFFFFFFFFFFFFFFFF)
SMB: NT status code = 0x0, Facility = System, Severity = Success, Code = (0) STATUS_SUCCESS
SMB: NT Status Severity Code = Success
SMB: NT Status Customer Code = 0 (0x0)
SMB: NT Status Reserved Bit = 0 (0x0)
SMB: NT Status Facility = System
SMB: NT Status Code System Success = STATUS_SUCCESS
SMB: Header: PID = 0xFEFF TID = 0x4004 MID = 0x3041 UID = 0x7003
SMB: Tree ID (TID) = 16388 (0x4004)
SMB: Process ID (PID) = 65279 (0xFEFF)
SMB: User ID (UID) = 28675 (0x7003)
SMB: Multiplex ID (MID) = 12353 (0x3041)
SMB: Flags Summary = 24 (0x18)
SMB: .......0 = Lock & Read and Write & Unlock not supported
SMB: ......0. = Send No Ack not supported
SMB: ....1... = Using caseless pathnames
SMB: ...1.... = Canonicalized pathnames
SMB: ..0..... = No Opportunistic lock
SMB: .0...... = No Change Notify
SMB: 0....... = Client command
SMB: flags2 Summary = 51207 (0xC807)
SMB: ...............1 = Understands long filenames
SMB: ..............1. = Understands extended attributes
SMB: ...0............ = No DFS namespace
SMB: ..0............. = No paging of IO
SMB: .1.............. = Using NT status codes
SMB: 1............... = Using UNICODE strings
SMB: Unknown Flag2 bits = 2052 (0x804)
SMB: Command = C lock & X
SMB: Word count = 8
SMB: Word parameters
SMB: Next offset = 0xDEDE
SMB: File ID (FID) = 16388 (0x4004)
SMB: File name =\My Documents\Desktop.ini
SMB: Lock type = 0x0010
SMB: ...............0 = Lock out all access
SMB: ..............0. = not Oplock Break.
SMB: .............0.. = not Change Lock.
SMB: ............0... = not Cancel Lock
SMB: ...........1.... = Large File Lock.
SMB: Open timeout = -1
SMB: Number of unlocks = 1
SMB: Number of locks = 0
SMB: Byte count = 20
SMB: Byte parameters
SMB: Unlock range
SMB: Process ID (PID) = 65279 (0xFEFF)
SMB: File Offset (NT) = 0x0000000000000000
SMB: Lock Length (NT) = 0xFFFFFFFFFFFFFFFF
SMB: Command = No secondary command
Edit: This is actually kind of a crappy example since it was locking a single block in the file that consisted of the entire file!
Point was: SMB will handle locking portions of a file or the whole file. Give it a try
