Various little questions
Richard Sharpe
rsharpe at richardsharpe.com
Wed Oct 1 05:27:12 GMT 2003
On Wed, 1 Oct 2003, Christopher R. Hertel wrote:
> Well folks, I've managed to find myself back in the role of
> annoying-little-question-asker. :)
>
> My annoying little questions:
>
> 1) Kernel oplocks
>
> The smb.conf manpage (for V3.0) does not come right out and say it, but
> it suggests that the kernel oplock break is an all-or-nothing deal.
> In other words, there is no mechanism that allows the kernel to report
> that a process has opened an oplocked file in read-only mode, so the
> SMB client cannot be downgraded to a level2 oplock.
>
> Do I understand that correctly?
>
> Here's an example of what I mean. Suppose client CARTER opens a file
> and requests an OpLock. Samba on server SIMO grants the OpLock. About
> three minutes later process POTTER running on server SIMO opens the
> same file for read-only access.
>
> Optimally, server SIMO would send an OpLock break to client CARTER
> downgrading the OpLock to a level2 OpLock, but that can only happen if
> the kernel can report that new open was read-only.
>
> Can Linux (or IRIX) kernel oplocks do that?
Well, if Samba does an open(file-name, O_RDONLY, ...), then yes, the
kernel has the required information, and Samba should convert a read-only
open into O_RDONLY. There are, however, some interactions between
DENY_MODE locks and OpLocks that almost require NTCreate&X in the Kernel.
Regards
-----
Richard Sharpe, rsharpe[at]ns.aus.com, rsharpe[at]samba.org,
sharpe[at]ethereal.com, http://www.richardsharpe.com
More information about the samba-technical
mailing list