[PATCH] Improve code in ctdb lock helper

Amitay Isaacs amitay at gmail.com
Wed Jan 11 04:42:11 UTC 2017


On Fri, Dec 16, 2016 at 10:21 AM, Amitay Isaacs <amitay at gmail.com> wrote:

> On Wed, Dec 14, 2016 at 6:39 PM, Amitay Isaacs <amitay at gmail.com> wrote:
>
>>
>> On Fri, Dec 2, 2016 at 4:19 PM, Amitay Isaacs <amitay at gmail.com> wrote:
>>
>>> On Fri, Dec 2, 2016 at 4:06 AM, Jeremy Allison <jra at samba.org> wrote:
>>>
>>>> On Thu, Dec 01, 2016 at 10:47:06AM +0100, Volker Lendecke wrote:
>>>> > On Thu, Dec 01, 2016 at 03:33:09PM +1100, Amitay Isaacs wrote:
>>>> > > Hi,
>>>> > >
>>>> > > Here are two patches that do the following:
>>>> > >
>>>> > > 1. Drop the support for locking multiple databases since it's not
>>>> required
>>>> > > any more.
>>>> > > 2. Add explicit unlocking of record/db when lock helper is exiting
>>>> >
>>>> > Are we sure that we only ever call async signal safe functions in the
>>>> > tdb functions? For example I'm pretty certain that tdb_close calls
>>>> > free(), which is not async signal safe. What happens for example if
>>>> > the signal comes before we expect it, and we are in a malloc call?
>>>> > This would block the child forever.
>>>> >
>>>> > Can we change this to not call tdb functions directly in the signal
>>>> > handler but set a global variable, expecting EINTR at all relevant
>>>> > points?
>>>>
>>>> Oh god yes. The list of things you can do inside a signal
>>>> handler is vanishingly small, and tdb calls are certainly
>>>> not on that list.
>>>>
>>>
>>> Yes, point well taken. I will rework the patch.
>>>
>>>
>> Here are the modified patches.  I have also opened a samba defect, so
>> this fix can be back ported.
>>
>> Amitay.
>>
>>
> Here are the patches after fixing a typo.
>
> Please review and push.
>
> Amitay.
>
>
Here are the patches to work around robust mutex bug in CTDB by explicitly
unlocking robust mutexes.

The test code has been improved and does not use signal handlers.

Please review and push.

Amitay.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ctdb.patches
Type: application/octet-stream
Size: 18407 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170111/5a5214bc/ctdb.obj>


More information about the samba-technical mailing list