[Samba] oplocks, kernel oplocks, kernel share modes, .. - how it all works?

Jeremy Allison jra at samba.org
Tue Jan 24 22:51:32 UTC 2023


On Wed, Jan 25, 2023 at 12:58:47AM +0300, Michael Tokarev wrote:
>25.01.2023 00:43, Jeremy Allison via samba wrote:
>>On Tue, Jan 24, 2023 at 01:39:34PM -0800, Jeremy Allison via samba wrote:
>>>
>>>Locking and share modes have bugger-all to do with leases and oplocks.
>>>
>>>Please separate the two in your mind, things will make
>>>much more sense when you do :-).
>>
>>Actually, separate the three :-).
>
>Yes. I know the concepts, I understand quite well how they works.
>I wrote a wiki page about it yesterday. They're definitely separate
>in my mind :)
>
>What I mean is that inotify mechanism can be used by smbd to at
>least tell windows that the lease/oplock should be broken now.

No, that's too dangerous and will lead to file corruption.

inotify is an asynchronous notification. oplocks and
leases *require* the local client be stopped from
access (by the kernel) until the existing opener
grants access.

Remember, the file data may be partly on the client,
partly on the server until the oplock/lease is revoked.



More information about the samba mailing list