[PATCH] Convert Samba to OFD locking.

Richard Sharpe realrichardsharpe at gmail.com
Thu May 19 14:25:45 UTC 2016


On Thu, May 19, 2016 at 1:44 AM, Stefan Metzmacher <metze at samba.org> wrote:
> Am 19.05.2016 um 07:14 schrieb Uri Simchoni:
>> On 05/19/2016 12:42 AM, Jeremy Allison wrote:
>>> Hi Jeff, Steve and Simo,
>>>
>>> Here is the patchset we discussed to convert
>>> smbd to open file description locking on
>>> modern kernels. It also includes a regression
>>> test to ensure we stay working even on systems
>>> that don't have the required kernels :-).
>>>
>>> Now all we need is the fix you and I discussed
>>> to the calls to CIFSSMBPosixLock() to convert
>>> the lock context from current->tgid for process-associated
>>> record locks to a handle-specific lock context
>>> for open file description record locks.
>>>
>>> This will put us in really good shape for
>>> doing the OFD-POSIX locks we need in the
>>> SMB2+ UNIX extensions protocol changes.
>>>
>>> Please review and let me know !
>>>
>>> Cheers,
>>>
>>> Jeremy.
>>>
>> Seems like the wscript test is a compile-time test. Should be a test
>> that runs code to verify the kernel actually supports it (or gets it
>> from the answer file and fails if there's no answer). The fcntl_lock
>> test just above it can be a good reference.
>>
>> Just my 2c, I have some learning curve to understand locking.
>
> I think we also need a runtime test similar to the robust mutex tests.
>
> It's not uncommon to run samba in an lxc container these days and there
> it could
> happen that the kernel is older or newer than the distribution within
> the container.

I am not sure that I believe the bit about the kernel being older than
the distro because glibc usually depends on (or uses) newer kernel
features, doesn't it?

> So we should handle both cases and only activate the feature at runtime
> if the current kernel supports it.
>
> (I haven't looked at the patches yet).
>
> metze
>



-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)



More information about the samba-technical mailing list