[PATCH] notifyd: fix memory alignment

Uri Simchoni urisimchoni at gmail.com
Thu Jul 16 18:47:53 UTC 2015


Best thing is to set up the DB fetching in a way that the data is
aligned when fetched (the parse function can verify this). I'll look
into it but xtdb experts can look into it without the learning curve.
Second best option is to have an array that grows as-needed. This
removes the allocations but not the copying.

Two other things:
1. The patch doesn't clearly show it - I got the alignment trap in
notifyd_trigger_parser()
2. If the notifyd process crashes, smbd continues to work, but change
notifications seem to stop working until the main smbd process is
restarted (this at least seem to be my user experience, haven't really
looked at the code). I don't know whether that should be considered as
a degradation or not. Would be better to exit all smbd processes, or
to recover, I think.

Thanks,
Uri

On Thu, Jul 16, 2015 at 6:20 PM, Volker Lendecke
<Volker.Lendecke at sernet.de> wrote:
> On Thu, Jul 16, 2015 at 12:40:59PM +0300, Uri Simchoni wrote:
>> Hi,
>>
>> Attached pls find a fix to a memory alignment issue in notifyd.
>>
>> I'm not familiar enough with the code to tell whether the
>> extra-allocation in the fix matters in terms of performance, but at
>> least this patch points at the issue.
>
> Your patch will certainly work. Today I can't really look
> deeper, but this needs fixing before 4.3.
>
> One quick comment: This is a pretty hot code path, I would
> search for ways to do this without malloc (or talloc for
> that matter).
>
> Thanks!
>
> Volker
>
> --
> SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
> phone: +49-551-370000-0, fax: +49-551-370000-9
> AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
> http://www.sernet.de, mailto:kontakt at sernet.de



More information about the samba-technical mailing list