[PATCH] Improve code in ctdb lock helper
amitay at gmail.com
Wed Dec 14 07:39:55 UTC 2016
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
>> > > 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 18850 bytes
Desc: not available
More information about the samba-technical