Jeremy Allison
2023-Jan-24 21:57 UTC
[Samba] oplocks, kernel oplocks, kernel share modes, .. - how it all works?
On Tue, Jan 24, 2023 at 09:51:01PM +0000, Rowland Penny via samba wrote:> >So, are we back to what I said originally ? that it is a BAD idea to >locally modify anything in a Samba share and it should only be >modified by Samba or from a SMB client ?It is... inadvisable to do local modifications. Having said that the "kernel oplocks" parameter (when set in the [global] section only) on Linux will allow this to be done safely w.r.t. file-level caching at the cost of falling back to the old oplock model rather than the modern SMB2 leases. It will depend on applications being used that understand each others locking and simultaneous open semantics in order to be safe though. So yeah. Advanced option, only use if you *really* know what you're doing and understand the risks involved. I think Michael is asking the right questions to get to something that will work for him. And after all, the purpose of this list is to help people to use Samba to do really dangerous things :-) :-) :-).
Rowland Penny
2023-Jan-24 22:08 UTC
[Samba] oplocks, kernel oplocks, kernel share modes, .. - how it all works?
On 24/01/2023 21:57, Jeremy Allison wrote:> On Tue, Jan 24, 2023 at 09:51:01PM +0000, Rowland Penny via samba wrote: >> >> So, are we back to what I said originally ? that it is a BAD idea to >> locally modify anything in a Samba share and it should only be >> modified by Samba or from a SMB client ? > > It is... inadvisable to do local modifications. Having said that > the "kernel oplocks" parameter (when set in the [global] section only) > on Linux will allow this to be done safely w.r.t. file-level caching > at the cost of falling back to the old oplock model rather than the > modern SMB2 leases. > > It will depend on applications being used that understand each > others locking and simultaneous open semantics in order to be > safe though. > > So yeah. Advanced option, only use if you *really* know what > you're doing and understand the risks involved. > > I think Michael is asking the right questions to get to something > that will work for him. And after all, the purpose of this > list is to help people to use Samba to do really dangerous > things :-) :-) :-).Whilst I can fully understand what you are trying to say, I still think that it is a bad idea to locally modify files on a Samba share. I also think that what Michael requires is a good thing, it just isn't really possible at this time, perhaps Samba could be enhanced to do it, so it might be an idea to open a bug report so it doesn't get forgotten. The major problem will be in getting external programs to work with the Samba files and that will not be easy. Rowland