[PATCH] Improve code in ctdb lock helper

Amitay Isaacs amitay at gmail.com
Thu Dec 15 23:21:50 UTC 2016


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ctdb.patches
Type: application/octet-stream
Size: 18852 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20161216/6ae57927/ctdb.obj>


More information about the samba-technical mailing list