Registering the oplock break handlerThe smbd server forks a new smbd process to handle a new incoming request by a SMB client.
As part of initialisation of the new smbd process an oplock break handler is initialised.
The oplock message queue is registered along with the necessary call backs.
This is the oplock break handler which handles oplock break requests coming in for files opened by this smbd process.
Triggering an oplock break
For another smbd process attempting to open the file, we end up calling the handler open_file_ntcreate().
In this case, we are not looking at the scenario where kernel oplocks are enabled. Kernel oplocks are useful when you other processes(eg: NFS) using the filesystem exported by samba at the same time. Without kernel oplocks, other processes cannot safely use the filesystem since the locking info is stored by samba in its own databases.
Thus the oplock break is trigerred.