[PATCH] CTDB fixes in sock_daemon and socket I/O code

Amitay Isaacs amitay at gmail.com
Thu Jan 5 04:51:26 UTC 2017


On Thu, Jan 5, 2017 at 2:40 PM, Martin Schwenke <martin at meltin.net> wrote:

> On Thu, 5 Jan 2017 11:06:43 +1100, Amitay Isaacs <amitay at gmail.com>
> wrote:
>
> > On Thu, Jan 5, 2017 at 9:45 AM, Martin Schwenke <martin at meltin.net>
> wrote:
> >
> > > On Thu, 5 Jan 2017 00:54:30 +1100, Amitay Isaacs <amitay at gmail.com>
> > > wrote:
> > >
> > > > Here are the fixes to sock_daemon and sock_io abstractions with
> tests.
> > > >
> > > > This should fix the flakey ctdb autobuild.
> > > >
> > > > Please review and push.
> > >
> > > The 4th commit breaks the -O3 developer build:
> > >
> > > [194/292] Compiling tests/src/sock_io_test.c
> > > ../tests/src/sock_io_test.c: In function ‘test1_writer’:
> > > ../tests/src/sock_io_test.c:64:3: error: dereferencing type-punned
> > > pointer will break strict-aliasing rules [-Werror=strict-aliasing]
> > >    *(uint32_t *)buf = buflen;
> > >    ^
> > > ../tests/src/sock_io_test.c: In function ‘test2_writer’:
> > > ../tests/src/sock_io_test.c:195:3: error: dereferencing type-punned
> > > pointer will break strict-aliasing rules [-Werror=strict-aliasing]
> > >    *(uint32_t *)buf = buflen;
> > >    ^
> > > cc1: all warnings being treated as errors
> > >
> > > :-(
> > >
> > >
> > Good catch.  Here are the patches again with fixes for O3 build.
> >
> > Also pushed to my ctdb-eventd branch.
>
> Looks good.  Can we please add some details to the commit message for
> commit #3?  It took me a long time to understand what the problem was.
> Now that I understand it, it is blindingly obvious...  but it hurt my
> brain!  :-)
>
> Something like:
>
>   queue->offset currently points to the end of available data.
>   However, it is mistakenly also treated like the beginning of
>   subsequent data by adding the packet size after processing a
>   packet.  Instead, use queue->end to point to the end of available
>   data and queue->begin to point to the beginning of unprocessed data.
>
> With an improved commit message...
>
> Reviewed-by: Martin Schwenke <martin at meltin.net>
>
> I won't push right now because I'm about to post another important
> fix...  :-)
>
>
I have fixed the commit message for the third commit and also added an
extra commit which fixes the race condition in cluster_wait computation (as
discussed).

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


More information about the samba-technical mailing list