Bug #14866

Updated by Gordon Ross about 2 months ago

Cache delegations via SMB ("oplocks") are meant to be coherent with NFS cache delegations.    However, when illumos 11016 (SMB2 oplock leases) went in, the mechanism implementing that coordination was accidentally dropped. 

 Without the fix, cache delegations could lead to cache incoherency.    For example, 
 if an SMB cache delegation (a.k.a. SMB oplock) were to be left in effect when it should have been recalled, that could result in an SMB client overwriting data written from NFS or a local process, once the SMB client writes back it's cache.    Only multi-protocol cases are affected, or protocol vs. local access.    Using SMB exclusively, or NFS exclusively, both avoid this defect. 

 Fix is: 
 Import this commit from 

 commit 3afddaed30a19c57d474ecb7e358181f7eba5274 
 Author: Gordon Ross <> 
 Date:     Wed Aug 26 17:48:44 2020 +0000 

     FIR-521 SMB oplock not recalled when there is a request from NFS 
     Reviewed by: Prashanth Badari <> 
     Reviewed by: Suresh Jayaraman <> 

 3 	 1 	 usr/src/cmd/smbsrv/testoplock/smbsrv/smb_kproto.h 
 12 	 1 	 usr/src/cmd/smbsrv/testoplock/tol_main.c 
 48 	 7 	 usr/src/uts/common/fs/smbsrv/smb_cmn_oplock.c