[SCM] CTDB repository - branch 2.5 updated - ctdb-2.5.5-80-g3d66d76

Amitay Isaacs amitay at samba.org
Tue Mar 1 04:54:19 UTC 2016


The branch, 2.5 has been updated
       via  3d66d7604bfaebb387b5184e9e77d874c633c0b9 (commit)
       via  1279814d3682a1a62ae93e5228e14fd6949576ed (commit)
       via  a9e4b5e3461cc4d096a8b055ea3202c2c8711c12 (commit)
       via  155464da6261c2acf07f29173a0755fa7bcc0223 (commit)
       via  6336f27e6eb25f64c9e412d7fdc8bef5f8a6768c (commit)
       via  7fa2e78ea48603423cdb0d17dd4b69bf22237e16 (commit)
       via  f6bd7256a50daa99d2bd8e4d83b613d8bd4d6d24 (commit)
       via  b5ad35c21ee0faaaa3fac50abab00d03a2c2d7cb (commit)
       via  3a722beb42bd8bdf985d9ee90a7a63738162b9ed (commit)
       via  3056f97aee3ce970c2190f1ca045dc5cf710eecb (commit)
       via  cc1017637bf16d412d75e03874c44b4a9d934cba (commit)
       via  f21fe3ebf74f345bc75707504e8616c8860feeac (commit)
       via  81c943144df25edbd40530ebc51bfd8bb45e6af1 (commit)
       via  d2f6e4e94c70ab559d4420398ed6efe2d73c9584 (commit)
       via  4cd1b54c0e38511d078dc239c4607da216705e18 (commit)
       via  898a217b393c04d75cadf4b6903524b29874fbd6 (commit)
       via  bdb9fcebbee9995b5351f04297cdbc608b779338 (commit)
       via  b533cf2a868ddb7176042111dd88afab42c25d76 (commit)
       via  613136d7a6c51133bfd6d8e2d48bfd873ea73f5a (commit)
       via  1e1e1f1a3139a463beb062ad29a124a93d6f9379 (commit)
       via  d7e496eefffbabe3a894177729112effdf3d0564 (commit)
       via  ab5761b0cfa4804fc10dafa82588148bd2b48cef (commit)
       via  5fff429fcf00d6c6d7d919e10a23fa97a5c1eb85 (commit)
       via  503d00b8423e2a50b799b75a8f31bdd47affb34a (commit)
       via  f68a8e461cbdab926ed106b62c9b803d9fd59a8c (commit)
       via  9b348c71b83a685b547e9b2839a39043c08c4a7c (commit)
       via  a1a6b0d02ac3833c9c96f3f07673dd3fdb034113 (commit)
       via  de147dde8ae7edddadcccebbd2fe97f570f40135 (commit)
       via  9700691610cf5ae66471a9e65c9b0362b888e004 (commit)
       via  c3f175c68030ea94b713fe30a1e2b9b1a46854d3 (commit)
       via  7597b3782e81eea364167cb6de7ef9b71b18e023 (commit)
       via  3162881869a12efc7cb1c2ad9e1467cf1770fb80 (commit)
       via  2f18291b0a6752c32b0f75b4c792a1bbe6b88d8a (commit)
       via  b5933c52b90ee3910c026fa964cae8c2bacf27db (commit)
       via  49b292cdc23f4aed4a192ca473613465427025cf (commit)
       via  2a51338d4236eae0bb41bf419ac98572403c14a3 (commit)
       via  ec25989be4b063ecf9f17254cc5e431e8a9ef0d7 (commit)
       via  e91e352e87788e5546ef5895d283fceb69f2bde2 (commit)
       via  c8fd374939669664c2d88a3fc3e9c3ac3632009f (commit)
       via  77bf6c5805e83e671406d07566b79297e8a2ae7c (commit)
       via  37cc67f1847a04aeb32e5ad93e76c6e3f4fa8811 (commit)
       via  8bab7d4737a223645ffc6ecc7d7d30f82bd9e863 (commit)
       via  d4b36475621eafcbba6d8a9ba81130169586ebe5 (commit)
       via  ea38a6f5ec3129edd293e91ff988785390497c18 (commit)
       via  88adc979f2be0517bd6b73470ee3e512fc9f180d (commit)
      from  b0ac45fcb7097d9db965a7c3858de872e16387b6 (commit)

https://git.samba.org/?p=ctdb.git;a=shortlog;h=2.5


- Log -----------------------------------------------------------------
commit 3d66d7604bfaebb387b5184e9e77d874c633c0b9
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Feb 25 10:12:42 2016 +1100

    Update NEWS
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 1279814d3682a1a62ae93e5228e14fd6949576ed
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Dec 18 15:33:38 2015 +1100

    scripts: Fix regression in updateip code
    
    Regression introduced in commit
    6471541d6d2bc9f2af0ff92b280abbd1d933cf88.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    (Imported from commit d8e4c5a468286ecc1c38ecd66a3606e84db02373)

commit a9e4b5e3461cc4d096a8b055ea3202c2c8711c12
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Jan 11 13:41:30 2016 +1100

    daemon: Don't leak memory if not using recovery lock
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    (Imported from commit 24160ee6a4a0727840d73955b99aef690450f345)

commit 155464da6261c2acf07f29173a0755fa7bcc0223
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Dec 17 12:27:58 2015 +1100

    daemon: Drop the "schedule for deletion" messages to DEBUG level
    
    Thousands of these can be generated each second, rendering INFO level
    debugging useless.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    (Imported from commit 8f73ae03cc50f26e85b78e35bf22e40eb1ff7684)

commit 6336f27e6eb25f64c9e412d7fdc8bef5f8a6768c
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Jan 7 21:14:05 2016 +0100

    Fix CID 1347319 Unchecked return value
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    (Imported from commit 0cb8b9d113b322f784100365669d2be8b7fa635a)

commit 7fa2e78ea48603423cdb0d17dd4b69bf22237e16
Author: Ralph Boehme <slow at samba.org>
Date:   Sun May 10 01:39:16 2015 +0200

    ping_pong: add -l option
    
    Add a new option -l to check whether POSIX byte range locks are
    working. Usage:
    
    node1$ touch /path/to/cluster-fs/FILE
    
    node1$ ./bin/ping_pong -l /path/to/cluster-fs/FILE
    Holding lock, press any key to continue...
    You should run the same command on another node now.
    
    node2$ ./bin/ping_pong -l /path/to/cluster-fs/FILE
    
    Output can either be:
    
      Holding lock, press any key to continue...
    
    This means POSIX byte range locks are *not* working.
    
    If you see this instead:
    
      file already locked, calling check_lock to tell us who has it locked...:
      check_lock failed: lock held: pid='27375', type='1', start='0', len='0'
      Working POSIX byte range locks
    
    Congrats, you have a cluster fs with functional byte range locks!
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Dec 10 08:48:38 CET 2015 on sn-devel-104
    
    (Imported from commit 2f16675a2294c8197ad45862c3e8a4fa2061d2e9)

commit f6bd7256a50daa99d2bd8e4d83b613d8bd4d6d24
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Sep 3 16:25:02 2015 +0200

    Fix a 32-bit problem
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Thu Sep  3 22:12:02 CEST 2015 on sn-devel-104
    
    (Imported from commit 239062a062bb70c50bf884885b58054c44c9ebf8)

commit b5ad35c21ee0faaaa3fac50abab00d03a2c2d7cb
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Aug 19 07:35:32 2015 +0200

    Fix some clang uninitialized errors
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    (Imported from commit 963874279997b98c8b29bee6d2417f81a0e8b0d2)

commit 3a722beb42bd8bdf985d9ee90a7a63738162b9ed
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon Aug 3 15:36:06 2015 +1000

    pmda: Add missing prototype declaration for non-static function
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11434
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    
    (Imported from commit 6538ba5243a043bc727039a16a7a9d5d8027fa06)

commit 3056f97aee3ce970c2190f1ca045dc5cf710eecb
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Jul 7 20:49:38 2015 +1000

    scripts: Fix regression in VLAN interface support
    
    Commit 6471541d6d2bc9f2af0ff92b280abbd1d933cf88 broke support for VLAN
    interfaces.  Releasing a public IP address depends on
    ip_maskbits_iface() and for a VLAN interface this will return an
    interface of the form <vlan>@<iface>, which can't be fed back into
    "ip" commands.
    
    Update ip_maskbits_iface() to drop the '@' and everything after it.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    Reported-by: Jan Schwaratzki <jschwaratzki at ddn.com>
    
    (Imported from commit 87c5c96b767aa317dd620f89ac3e11bb40dae70f)

commit cc1017637bf16d412d75e03874c44b4a9d934cba
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Jul 6 14:32:15 2015 -0700

    Accept hex format for pdelete and ptrans commands
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    (Imported from commit cd55349e9b0cfc9bb8c04a5cfa3c142efead6b83)

commit f21fe3ebf74f345bc75707504e8616c8860feeac
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Jul 6 13:07:33 2015 -0700

    Create helper function for optional hex input
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    (Imported from commit 663db9fbb028fe524bb0eef09398c62bf4fb08d4)

commit 81c943144df25edbd40530ebc51bfd8bb45e6af1
Author: Christof Schmitt <cs at samba.org>
Date:   Thu Jul 2 13:06:32 2015 -0700

    Accept the key in hex format for the pstore command
    
    This follows the same pattern as the tstore command, and it allows
    specifying key strings with a trailing \0 character.
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Mon Jul  6 23:23:22 CEST 2015 on sn-devel-104
    
    (Imported from commit cdbc6d92c6bf0645c5a23955e8ec5e253212e86d)

commit d2f6e4e94c70ab559d4420398ed6efe2d73c9584
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jun 24 21:06:22 2015 +1000

    scripts: Only write to /proc route flush files if they exist
    
    On IPv4-only or IPv6-only systems one of these files will not exist.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit 0c609c95051ff8c1e8fd61acc6abc7e4b4c4441b)

commit 4cd1b54c0e38511d078dc239c4607da216705e18
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed May 20 04:19:09 2015 +1000

    scripts: Create the directory containing the recovery lock
    
    This will handle the most obvious cases.  It won't handle the case
    where the directory is missing and the recovery lock location is
    updated at run-time.  However, this is a good improvement.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit 27674c413de5cadae633c834d4f2e41f26ab455e)

commit 898a217b393c04d75cadf4b6903524b29874fbd6
Author: Volker Lendecke <vl at samba.org>
Date:   Sun May 3 09:34:41 2015 +0000

    ping_pong: Fix CID 1273087 Resource leak
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>
    
    (Imported from commit bfbaf51cd627b2d1052dd23be4b0df5e004cc92f)

commit bdb9fcebbee9995b5351f04297cdbc608b779338
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon May 4 15:27:19 2015 +1000

    Revert "ctdb-recoverd: Abort when daemon can take recovery lock during recovery"
    
    This reverts commit 39d2fd330a60ea590d76213f8cb406a42fa8d680.
    
    An election can occur in the middle of a recovery.  During the
    election the recovery master can change.  When a node loses a round of
    the election and stops being the recovery master it releases the
    recovery lock.  Then at the end of the ongoing recovery all nodes are
    able to take the recovery lock so they will all abort.
    
    The most likely cause for a change in recovery master is that several
    (all?) nodes are starting up and the "connected-ness" of each node is
    a primary factor in winning the election.  In this situation the
    recovery master can bounce around the cluster.
    
    The simplest solution is to revert this patch so that the recovery
    will fail.  The new recovery master will then start a new recovery.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
    Autobuild-Date(master): Mon May  4 10:40:36 CEST 2015 on sn-devel-104
    
    (Imported from commit 20a7945a2695d7ed811237adde5af6549e53c6e9)

commit b533cf2a868ddb7176042111dd88afab42c25d76
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Apr 28 23:15:37 2015 +1000

    scripts: Run tdb checker under timeout command
    
    If tdb database file size grows beyond 4GB, tdbtool/tdbdump can hang
    indefinitely.  This will prevent CTDB from starting up.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    
    (Imported from commit f6af2d96c275ad7614671aabac1e21f9d58b1585)

commit 613136d7a6c51133bfd6d8e2d48bfd873ea73f5a
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Apr 20 09:53:23 2015 +1000

    scripts: New configuration variable CTDB_NODE_ADDRESS
    
    Required when automatic address detection can not be used.  This can
    be the case when running multiple ctdbd daemons/nodes on the same
    physical host (usually for testing), using InfiniBand for the private
    network or on Linux when sysctl net.ipv4.ip_nonlocal_bind=1.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
    Autobuild-Date(master): Mon Apr 27 06:10:08 CEST 2015 on sn-devel-104
    
    (Imported from commit 0621f07eb482daf7495f6314b0af32853573cb82)

commit 1e1e1f1a3139a463beb062ad29a124a93d6f9379
Author: Martin Schwenke <martin at meltin.net>
Date:   Sun Apr 19 19:45:41 2015 +1000

    scripts: Replace uses of "ctdb pnn" with ctdb_get_pnn()
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit 1092f9755fed331251ae508f1e04e85dc47ae902)

commit d7e496eefffbabe3a894177729112effdf3d0564
Author: Martin Schwenke <martin at meltin.net>
Date:   Sat Apr 18 22:00:49 2015 +1000

    scripts: Changed uses of "ctdb xpnn" to ctdb_get_pnn()
    
    "ctdb xpnn" does not work when sysctl net.ipv4.ip_nonlocal_bind=1,
    since it determines the node by attempting to bind to each addres in
    the nodes file.  The solution is to not use "ctdb xpnn".  After the
    initial call, ctdb_get_pnn() will be more efficient that "ctdb xpnn".
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit 09b5e4978ab1df09f47156147848a6bf099ea665)

commit ab5761b0cfa4804fc10dafa82588148bd2b48cef
Author: Martin Schwenke <martin at meltin.net>
Date:   Sat Apr 18 21:55:50 2015 +1000

    tests: New function ctdb_set_pnn() to change PNN
    
    ctdb_get_pnn() incorrectly caches to the same file regardless of what
    node is selected via FAKE_CTDB_PNN.
    
    Instead, set the PNN using new function ctdb_get_pnn(), which also
    makes CTDB_VARDIR point to a node-specific subdirectory.  This means
    that ctdb_get_pnn() will correctly cache to the node-specific
    directory.
    
    Fake tickle and TDB files/directories used by the ctdb stub need to be
    the same across all PNNs, so change these to use
    $EVENTSCRIPTS_TESTS_VAR_DIR instead of node-specific $CTDB_VARDIR.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit af93ae1a540003824b32301d3c9f09c713f1fa7a)

commit 5fff429fcf00d6c6d7d919e10a23fa97a5c1eb85
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Apr 17 20:44:15 2015 +1000

    scripts: New function ctdb_get_pnn() does cached retrieval of PNN
    
    This avoids the expense of establishing a client connection to the
    daemon just to get the PNN of the current node.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit 579dda6858f547d360073cd67235e49ab03b355e)

commit 503d00b8423e2a50b799b75a8f31bdd47affb34a
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Apr 21 10:34:54 2015 +0200

    Fix the O3 developer build
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    (Imported from commit b8ac9853b0483fc4af82f731337464f9b5aaf53c)

commit f68a8e461cbdab926ed106b62c9b803d9fd59a8c
Author: Rajesh Joseph <rjoseph at redhat.com>
Date:   Thu Apr 16 11:55:53 2015 +0530

    Coverity fix for CID 1125630
    
    Due to usage of CTDB_NO_MEMORY macro,
    some of the resources are not freed in failure cases.
    
    Signed-off-by: Rajesh Joseph <rjoseph at redhat.com>
    Reviewed-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    Autobuild-User(master): G√ľnther Deschner <gd at samba.org>
    Autobuild-Date(master): Fri Apr 17 16:49:05 CEST 2015 on sn-devel-104
    
    (Imported from commit 9b33732a57a919059bf17e9348a60019146e9e1d)

commit 9b348c71b83a685b547e9b2839a39043c08c4a7c
Author: Rajesh Joseph <rjoseph at redhat.com>
Date:   Thu Apr 16 12:25:28 2015 +0530

    Coverity fix for CID 1125625
    
    Memory allocated by ctdb_sys_find_ifname is not
    freed by the caller.
    
    Signed-off-by: Rajesh Joseph <rjoseph at redhat.com>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    (Imported from commit a689cd5d955214fe94f19af9d1b5aec6d44d568a)

commit a1a6b0d02ac3833c9c96f3f07673dd3fdb034113
Author: David Disseldorp <ddiss at samba.org>
Date:   Tue Mar 31 18:06:43 2015 +0200

    check for talloc_asprintf() failure
    
    Signed-off-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Wed Apr  1 15:36:03 CEST 2015 on sn-devel-104
    
    (Imported from commit 12309f8bfb70878bec5fcec4681eb4e463e07357)

commit de147dde8ae7edddadcccebbd2fe97f570f40135
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 26 13:11:14 2015 +0100

    Fix CID 1125615 Copy into fixed size buffer
    
    Might be a "can't happen", but strcpy always looks fishy
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    (Imported from commit 508b45fca93ca2dfb048fdf7465602bc34df42db)

commit 9700691610cf5ae66471a9e65c9b0362b888e004
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 26 13:06:26 2015 +0100

    Fix CID 1125634 Out-of-bounds write
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    (Imported from commit 93d4e801298d8ebb7261adbfc2bdb1a5fbe7115c)

commit c3f175c68030ea94b713fe30a1e2b9b1a46854d3
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Mar 7 10:29:21 2015 +0000

    Fix 1125553 Buffer not null terminated
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>
    
    (Imported from commit 621bd0784290f24e229caf0590206805f6f2e75c)

commit 7597b3782e81eea364167cb6de7ef9b71b18e023
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jun 11 18:16:34 2014 +0200

    build: fix building with external libtdb
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Jelmer Vernooij <jelmer at samba.org>
    
    (Imported from commit 4106cf2eb969da179720067c86728441442cde59)

commit 3162881869a12efc7cb1c2ad9e1467cf1770fb80
Author: Gregor Beck <gbeck at sernet.de>
Date:   Mon Mar 31 08:04:21 2014 +0200

    daemon avoid goto ctdb_remove_orphaned_ifaces()
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Reviewed-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Tue Apr  1 02:59:05 CEST 2014 on sn-devel-104
    
    (Imported from commit 6cdde2711b5b4ad09f9703b2558db7c5d90e9a35)

commit 2f18291b0a6752c32b0f75b4c792a1bbe6b88d8a
Author: Gregor Beck <gbeck at sernet.de>
Date:   Mon Mar 31 07:50:45 2014 +0200

    daemon take a shortcut in all_nodes_are_disabled()
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Reviewed-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    (Imported from commit dd56afc7df1149e809486bc0f1c336a42bc7c0aa)

commit b5933c52b90ee3910c026fa964cae8c2bacf27db
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Feb 7 17:32:12 2014 +1100

    recoverd: LCP2 cleanups
    
    * Remove unnecessary candimbl parameter.
    
      This parameter can be cheaply calculated in
      lcp2_failback_candidate().  The compiler will probably do an
      excellent job optimising it.  :-)
    
    * Clarify a debug statement
    
      This is much clearer than doing a complex recalculation of a known
      value.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit 24b734f084de36160d065dc639100eab3b186f6c)

commit 49b292cdc23f4aed4a192ca473613465427025cf
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Feb 7 14:28:54 2014 +1100

    recoverd: Optimise check for rebalance candidates in LCP2
    
    Currently this can be checked many times.  However, there's no point
    calling the rebalance/failback code at all if there are no rebalance
    candidates.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit 9e5ef44f32fad6606bd95e619f0720a72344e441)

commit 2a51338d4236eae0bb41bf419ac98572403c14a3
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Dec 15 20:28:53 2013 +0100

    Fix CID 1138340 Resource leak
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    (Imported from commit c943937ec69f6547533f34ae83a268960395b521)

commit ec25989be4b063ecf9f17254cc5e431e8a9ef0d7
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Dec 15 20:28:04 2013 +0100

    Fix CID 1138341 Resource leak
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    (Imported from commit b2937fd6186003740f3bef3c2f4fd54a4d3cf335)

commit e91e352e87788e5546ef5895d283fceb69f2bde2
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Nov 17 14:57:44 2015 +1100

    scripts: Fix CTDB_DBDIR=tmpfs support
    
    Various scripts (including debug_locks.sh, 00.ctdb, 05.system) need
    CTDB_DBDIR to point to the right place... but it doesn't.
    
    Move the rewriting of CTDB_DBDIR to loadconfig() so that it happens
    for all scripts.  Have this code set internal variable
    CTDB_DBDIR_TMPFS_OPTIONS so that ctdbd_wrapper can do the mount.
    
    This loses the generality that was present in dbdir_tmpfs_start() but
    it wasn't being used anyway.  If it is needed in the future then it
    will be in the git history.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
    Autobuild-Date(master): Wed Nov 18 11:51:54 CET 2015 on sn-devel-104
    
    (Imported from commit d9677894b7aa2248e1884ab9e21667879bf1e3c4)

commit c8fd374939669664c2d88a3fc3e9c3ac3632009f
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Oct 23 14:04:04 2015 +1100

    scripts: Add support for CTDB_DBDIR in tmpfs
    
    The tmpfs is mounted and unmounted by ctdbd_wrapper.  Format is
    CTDB_DBDIR=tmpfs:<tmpfs-options>.  The only default for the tmpfs is
    mode=700 - to override, specify a different value in <tmpfs-options>.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Mon Nov  9 10:58:32 CET 2015 on sn-devel-104
    
    (Imported from commit be670ef0103878d8d939de5972b567c4db404082)

commit 77bf6c5805e83e671406d07566b79297e8a2ae7c
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Oct 23 14:04:04 2015 +1100

    scripts: Improve CTDB wrapper shutdown code
    
    This will make it easier to run things after CTDB is stopped.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    (Imported from commit f05c6d32cce334d29e373f1e74f0b52cab14409d)

commit 37cc67f1847a04aeb32e5ad93e76c6e3f4fa8811
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Feb 8 15:55:17 2016 +1100

    scripts: Drop use of "smbcontrol winbindd ip-dropped ..."
    
    This is unnecessary in Samba >= 4.0 because winbindd monitors IP
    address itself and no longer needs to be told when they are dropped.
    The smbcontrol commands can hang if a node has recovery mode active
    because smbcontrol is unable to connect to the registry.  Therefore,
    the smbcontrol commands should be removed.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11719
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    
    (Imported from commit 519564bb35a0f840bc4d7c8c5a92441c97b49791)

commit 8bab7d4737a223645ffc6ecc7d7d30f82bd9e863
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Jul 30 16:49:35 2015 +1000

    scripts: Improve error handling for 50.samba testparm failure
    
    Also add tests.  Update testparm stub to fake error and timeout.  Add
    timeout stub.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit 7d04778c82a8f657b6ba0173c29529fa03ab7a25)

commit d4b36475621eafcbba6d8a9ba81130169586ebe5
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Oct 8 12:22:06 2014 +1100

    tests: Run transaction tests with externally imposed timeout
    
    This works around cases where ctdb_transaction gets stuck - this still
    needs to be debugged.  However, this change will at least cause
    individual tests to fail rather than having whole test runs time out.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit f4871b8736f22941b227c19656319033c0c812e8)

commit ea38a6f5ec3129edd293e91ff988785390497c18
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Apr 2 13:53:09 2015 +1100

    daemon: Reset database statistics when resetting statistics
    
    When the ctdb statistics is reset, reset per database statistics to keep
    it consistent with ctdb statistics.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    
    (Imported from commit 7949ce103f2062aa703a24f72e11be96dc497a7a)

commit 88adc979f2be0517bd6b73470ee3e512fc9f180d
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon Aug 3 15:02:43 2015 +1000

    system: Remove unused system specific calls
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    
    (Imported from commit d9030d8c10ebe6f95f33cbc691b5756d97395b0f)

-----------------------------------------------------------------------

Summary of changes:
 NEWS                                         |  43 ++++++
 client/ctdb_client.c                         |   2 +-
 common/system_aix.c                          |  18 ---
 common/system_freebsd.c                      |  32 -----
 common/system_gnu.c                          |  18 ---
 common/system_kfreebsd.c                     |  31 -----
 common/system_linux.c                        | 187 ++-------------------------
 config/ctdbd_wrapper                         |  62 +++++++--
 config/events.d/00.ctdb                      |   7 +-
 config/events.d/01.reclock                   |   5 +
 config/events.d/10.interface                 |   2 +-
 config/events.d/11.natgw                     |   8 +-
 config/events.d/49.winbind                   |   7 -
 config/events.d/50.samba                     |  45 +++++--
 config/events.d/62.cnfs                      |   4 +-
 config/events.d/70.iscsi                     |   7 +-
 config/events.d/91.lvs                       |   6 +-
 config/functions                             |  59 ++++++++-
 config/statd-callout                         |   8 +-
 doc/ctdbd.conf.5.xml                         |  40 +++++-
 include/ctdb_private.h                       |   5 +-
 lib/replace/test/testsuite.c                 |   3 +
 lib/tdb/libtdb.m4                            |  14 +-
 server/ctdb_control.c                        |   7 +
 server/ctdb_daemon.c                         |   4 +-
 server/ctdb_ltdb_server.c                    |  14 ++
 server/ctdb_recover.c                        |  20 ++-
 server/ctdb_takeover.c                       |  85 ++++++------
 server/ctdb_vacuum.c                         |  10 +-
 tcp/tcp_connect.c                            |   5 +
 tests/eventscripts/50.samba.monitor.110.sh   |  20 +++
 tests/eventscripts/50.samba.monitor.111.sh   |  25 ++++
 tests/eventscripts/50.samba.monitor.112.sh   |  13 ++
 tests/eventscripts/50.samba.monitor.113.sh   |  16 +++
 tests/eventscripts/etc-ctdb/rc.local         |   1 +
 tests/eventscripts/scripts/local.sh          |  19 ++-
 tests/eventscripts/statd-callout.005.sh      |   6 +-
 tests/eventscripts/statd-callout.006.sh      |   6 +-
 tests/eventscripts/stubs/ctdb                |   4 +-
 tests/eventscripts/stubs/testparm            |  36 +++++-
 tests/eventscripts/stubs/timeout             |   8 ++
 tests/simple/53_ctdb_transaction.sh          |  10 +-
 tests/simple/54_ctdb_transaction_recovery.sh |  12 +-
 tests/src/ctdb_porting_tests.c               |  18 ---
 tests/src/ctdb_takeover_tests.c              |   2 +-
 tests/src/ctdb_test_stubs.c                  |   7 +-
 tools/ctdb.c                                 | 116 +++++++++--------
 utils/ping_pong/ping_pong.c                  |  66 +++++++---
 utils/pmda/pmda_ctdb.c                       |   3 +-
 49 files changed, 634 insertions(+), 512 deletions(-)
 mode change 100755 => 100644 config/ctdbd_wrapper
 mode change 100755 => 100644 config/functions
 create mode 100755 tests/eventscripts/50.samba.monitor.110.sh
 create mode 100755 tests/eventscripts/50.samba.monitor.111.sh
 create mode 100755 tests/eventscripts/50.samba.monitor.112.sh
 create mode 100755 tests/eventscripts/50.samba.monitor.113.sh
 create mode 100755 tests/eventscripts/stubs/timeout


Changeset truncated at 500 lines:

diff --git a/NEWS b/NEWS
index 580d853..37d69b6 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,46 @@
+Changes in CTDB 2.5.6
+=====================
+
+User-visible changes
+--------------------
+
+* CTDB_DBDIR can now be set to tmpfs[:<tmpfs-options>]
+
+  This will cause volatile TDBs to be located in a tmpfs.  This can
+  help to avoid performance problems associated with contention on the
+  disk where volatile TDBs are usually stored.  See ctdbd.conf(5) for
+  more details.
+
+* Resetting statistics now also resets database statistics
+
+* ctdb CLI tool pstore/pdelete/ptrans now accept keys in hex format
+
+* New -l option to ping_pong for validation of fcntl(2) lock coherency
+
+Important bug fixes
+-------------------
+
+* Fixed a regression in the VLAN interface monitoring code
+
+* Reverted a change that intentionally caused an abort when the
+  recovery lock could be taken by a ctdbd process during recovery.
+  There were corner cases where this was no appropriate...
+
+* Numerous resource leak fixes, many of which were foudn by Coverity
+
+Important internal changes
+--------------------------
+
+* TDB checking is now done under a timeout
+
+  This avoid cases where tdbtool/tdbdump can hang indefinitely if the
+  database size grows to over 4GB.
+
+* The Samba eventscript now logs errors from testparm
+
+* Cleaned up route flushing code to avoid noise in logs
+
+
 Changes in CTDB 2.5.5
 =====================
 
diff --git a/client/ctdb_client.c b/client/ctdb_client.c
index 32c9357..d09e1c6 100644
--- a/client/ctdb_client.c
+++ b/client/ctdb_client.c
@@ -3845,7 +3845,7 @@ static bool server_id_exists(struct ctdb_context *ctdb, struct server_id *id)
 {
 	struct ctdb_server_id sid;
 	int ret;
-	uint32_t result;
+	uint32_t result = 0;
 
 	sid.type = SERVER_TYPE_SAMBA;
 	sid.pnn = id->vnn;
diff --git a/common/system_aix.c b/common/system_aix.c
index 41f61ae..a98d382 100644
--- a/common/system_aix.c
+++ b/common/system_aix.c
@@ -374,26 +374,8 @@ int ctdb_get_peer_pid(const int fd, pid_t *peer_pid)
 	return ret;
 }
 
-char *ctdb_get_process_name(pid_t pid)
-{
-	/* FIXME AIX: get_process_name not implemented */
-	return NULL;
-}
-
 int ctdb_set_process_name(const char *name)
 {
 	/* FIXME AIX: set_process_name not implemented */
 	return -ENOSYS;
 }
-
-bool ctdb_get_lock_info(pid_t req_pid, struct ctdb_lock_info *lock_info)
-{
-	/* FIXME AIX: get_lock_info not implemented */
-	return false;
-}
-
-bool ctdb_get_blocker_pid(struct ctdb_lock_info *reqlock, pid_t *blocker_pid)
-{
-	/* FIXME AIX: get_blocker_pid not implemented */
-	return false;
-}
diff --git a/common/system_freebsd.c b/common/system_freebsd.c
index 9597a7a..c5a816b 100644
--- a/common/system_freebsd.c
+++ b/common/system_freebsd.c
@@ -370,40 +370,8 @@ int ctdb_get_peer_pid(const int fd, pid_t *peer_pid)
 	return 1;
 }
 
-char *ctdb_get_process_name(pid_t pid)
-{
-	char path[32];
-	char buf[PATH_MAX];
-	char *ptr;
-	int n;
-
-	snprintf(path, sizeof(path), "/proc/%d/exe", pid);
-	n = readlink(path, buf, sizeof(buf));
-	if (n < 0) {
-		return NULL;
-	}
-
-	/* Remove any extra fields */
-	buf[n] = '\0';
-	ptr = strtok(buf, " ");
-	return strdup(ptr);
-	return NULL;
-}
-
 int ctdb_set_process_name(const char *name)
 {
 	/* FIXME FreeBSD: set_process_name not implemented */
 	return -ENOSYS;
 }
-
-bool ctdb_get_lock_info(pid_t req_pid, struct ctdb_lock_info *lock_info)
-{
-	/* FIXME FreeBSD: get_lock_info not implemented */
-	return false;
-}
-
-bool ctdb_get_blocker_pid(struct ctdb_lock_info *reqlock, pid_t *blocker_pid)
-{
-	/* FIXME FreeBSD: get_blocker_pid not implemented */
-	return false;
-}
diff --git a/common/system_gnu.c b/common/system_gnu.c
index 2ab1399..bf8f43c 100644
--- a/common/system_gnu.c
+++ b/common/system_gnu.c
@@ -363,26 +363,8 @@ int ctdb_get_peer_pid(const int fd, pid_t *peer_pid)
 	return 1;
 }
 
-char *ctdb_get_process_name(pid_t pid)
-{
-	/* FIXME GNU/Hurd: get_process_name not implemented */
-	return NULL;
-}
-
 int ctdb_set_process_name(const char *name)
 {
 	/* FIXME GNU/Hurd: set_process_name not implemented */
 	return -ENOSYS;
 }
-
-bool ctdb_get_lock_info(pid_t req_pid, struct ctdb_lock_info *lock_info)
-{
-	/* FIXME GNU/Hurd: get_lock_info not implemented */
-	return false;
-}
-
-bool ctdb_get_blocker_pid(struct ctdb_lock_info *reqlock, pid_t *blocker_pid)
-{
-	/* FIXME GNU/Hurd: get_blocker_pid not implemented */
-	return false;
-}
diff --git a/common/system_kfreebsd.c b/common/system_kfreebsd.c
index 41aa4d6..de7c891 100644
--- a/common/system_kfreebsd.c
+++ b/common/system_kfreebsd.c
@@ -363,39 +363,8 @@ int ctdb_get_peer_pid(const int fd, pid_t *peer_pid)
 	return 1;
 }
 
-char *ctdb_get_process_name(pid_t pid)
-{
-	char path[32];
-	char buf[PATH_MAX];
-	char *ptr;
-	int n;
-
-	snprintf(path, sizeof(path), "/proc/%d/exe", pid);
-	n = readlink(path, buf, sizeof(buf));
-	if (n < 0) {
-		return NULL;
-	}
-
-	/* Remove any extra fields */
-	buf[n] = '\0';
-	ptr = strtok(buf, " ");
-	return strdup(ptr);
-}
-
 int ctdb_set_process_name(const char *name)
 {
 	/* FIXME kFreeBSD: set_process_name not implemented */
 	return -ENOSYS;
 }
-
-bool ctdb_get_lock_info(pid_t req_pid, struct ctdb_lock_info *lock_info)
-{
-	/* FIXME kFreeBSD: get_lock_info not implemented */
-	return false;
-}
-
-bool ctdb_get_blocker_pid(struct ctdb_lock_info *reqlock, pid_t *blocker_pid)
-{
-	/* FIXME kFreeBSD: get_blocker_pid not implemented */
-	return false;
-}
diff --git a/common/system_linux.c b/common/system_linux.c
index 97a57ac..3bc04ba 100644
--- a/common/system_linux.c
+++ b/common/system_linux.c
@@ -100,7 +100,7 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface)
 		}
 
 		DEBUG(DEBUG_DEBUG, (__location__ " Created SOCKET FD:%d for sending arp\n", s));
-		strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name)-1);
+		strlcpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name));
 		if (ioctl(s, SIOCGIFINDEX, &ifr) < 0) {
 			DEBUG(DEBUG_CRIT,(__location__ " interface '%s' not found\n", iface));
 			close(s);
@@ -240,7 +240,13 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface)
 		ip6->ip6_hlim = 255;
 		ip6->ip6_src  = addr->ip6.sin6_addr;
 		/* all-nodes multicast */
-		inet_pton(AF_INET6, "ff02::1", &ip6->ip6_dst);
+
+		ret = inet_pton(AF_INET6, "ff02::1", &ip6->ip6_dst);
+		if (ret != 1) {
+			close(s);
+			DEBUG(DEBUG_CRIT,(__location__ " failed inet_pton\n"));
+			return -1;
+		}
 
 		nd_na = (struct nd_neighbor_advert *)(ip6+1);
 		nd_na->nd_na_type = ND_NEIGHBOR_ADVERT;
@@ -598,28 +604,6 @@ int ctdb_get_peer_pid(const int fd, pid_t *peer_pid)
 }
 
 /*
- * Find the process name from process ID
- */
-char *ctdb_get_process_name(pid_t pid)
-{
-	char path[32];
-	char buf[PATH_MAX];
-	char *ptr;
-	int n;
-
-	snprintf(path, sizeof(path), "/proc/%d/exe", pid);
-	n = readlink(path, buf, sizeof(buf)-1);
-	if (n < 0) {
-		return NULL;
-	}
-
-	/* Remove any extra fields */
-	buf[n] = '\0';
-	ptr = strtok(buf, " ");
-	return (ptr == NULL ? ptr : strdup(ptr));
-}
-
-/*
  * Set process name
  */
 int ctdb_set_process_name(const char *name)
@@ -630,158 +614,3 @@ int ctdb_set_process_name(const char *name)
 	procname[15] = '\0';
 	return prctl(PR_SET_NAME, (unsigned long)procname, 0, 0, 0);
 }
-
-/*
- * Parsing a line from /proc/locks,
- */
-static bool parse_proc_locks_line(char *line, pid_t *pid,
-				  struct ctdb_lock_info *curlock)
-{
-	char *ptr, *saveptr;
-
-	/* output of /proc/locks
-	 *
-	 * lock assigned
-	 * 1: POSIX  ADVISORY  WRITE 25945 fd:00:6424820 212 212
-	 *
-	 * lock waiting
-	 * 1: -> POSIX  ADVISORY  WRITE 25946 fd:00:6424820 212 212
-	 */
-
-	/* Id: */
-	ptr = strtok_r(line, " ", &saveptr);
-	if (ptr == NULL) return false;
-
-	/* -> */
-	ptr = strtok_r(NULL, " ", &saveptr);
-	if (ptr == NULL) return false;
-	if (strcmp(ptr, "->") == 0) {
-		curlock->waiting = true;
-		ptr = strtok_r(NULL, " ", &saveptr);
-	} else {
-		curlock->waiting = false;
-	}
-
-	/* POSIX */
-	if (ptr == NULL || strcmp(ptr, "POSIX") != 0) {
-		return false;
-	}
-
-	/* ADVISORY */
-	ptr = strtok_r(NULL, " ", &saveptr);
-	if (ptr == NULL) return false;
-
-	/* WRITE */
-	ptr = strtok_r(NULL, " ", &saveptr);
-	if (ptr == NULL) return false;
-	if (strcmp(ptr, "READ") == 0) {
-		curlock->read_only = true;
-	} else if (strcmp(ptr, "WRITE") == 0) {
-		curlock->read_only = false;
-	} else {
-		return false;
-	}
-
-	/* PID */
-	ptr = strtok_r(NULL, " ", &saveptr);
-	if (ptr == NULL) return false;
-	*pid = atoi(ptr);
-
-	/* MAJOR:MINOR:INODE */
-	ptr = strtok_r(NULL, " :", &saveptr);
-	if (ptr == NULL) return false;
-	ptr = strtok_r(NULL, " :", &saveptr);
-	if (ptr == NULL) return false;
-	ptr = strtok_r(NULL, " :", &saveptr);
-	if (ptr == NULL) return false;
-	curlock->inode = atol(ptr);
-
-	/* START OFFSET */
-	ptr = strtok_r(NULL, " ", &saveptr);
-	if (ptr == NULL) return false;
-	curlock->start = atol(ptr);
-
-	/* END OFFSET */
-	ptr = strtok_r(NULL, " ", &saveptr);
-	if (ptr == NULL) return false;
-	if (strncmp(ptr, "EOF", 3) == 0) {
-		curlock->end = (off_t)-1;
-	} else {
-		curlock->end = atol(ptr);
-	}
-
-	return true;
-}
-
-/*
- * Find information of lock being waited on for given process ID
- */
-bool ctdb_get_lock_info(pid_t req_pid, struct ctdb_lock_info *lock_info)
-{
-	FILE *fp;
-	struct ctdb_lock_info curlock;
-	pid_t pid;
-	char buf[1024];
-	bool status = false;
-
-	if ((fp = fopen("/proc/locks", "r")) == NULL) {
-		DEBUG(DEBUG_ERR, ("Failed to read locks information"));
-		return false;
-	}
-	while (fgets(buf, sizeof(buf), fp) != NULL) {
-		if (! parse_proc_locks_line(buf, &pid, &curlock)) {
-			continue;
-		}
-		if (pid == req_pid && curlock.waiting) {
-			*lock_info = curlock;
-			status = true;
-			break;
-		}
-	}
-	fclose(fp);
-
-	return status;
-}
-
-/*
- * Find process ID which holds an overlapping byte lock for required
- * inode and byte range.
- */
-bool ctdb_get_blocker_pid(struct ctdb_lock_info *reqlock, pid_t *blocker_pid)
-{
-	FILE *fp;
-	struct ctdb_lock_info curlock;
-	pid_t pid;
-	char buf[1024];
-	bool status = false;
-
-	if ((fp = fopen("/proc/locks", "r")) == NULL) {
-		DEBUG(DEBUG_ERR, ("Failed to read locks information"));
-		return false;
-	}
-	while (fgets(buf, sizeof(buf), fp) != NULL) {
-		if (! parse_proc_locks_line(buf, &pid, &curlock)) {
-			continue;
-		}
-
-		if (curlock.waiting) {
-			continue;
-		}
-
-		if (curlock.inode != reqlock->inode) {
-			continue;
-		}
-
-		if (curlock.start > reqlock->end ||
-		    curlock.end < reqlock->start) {
-			/* Outside the required range */
-			continue;
-		}
-		*blocker_pid = pid;
-		status = true;
-		break;
-	}
-	fclose(fp);
-
-	return status;
-}
diff --git a/config/ctdbd_wrapper b/config/ctdbd_wrapper
old mode 100755
new mode 100644
index fa0a269..71eddaf
--- a/config/ctdbd_wrapper
+++ b/config/ctdbd_wrapper
@@ -77,6 +77,39 @@ ctdbd_is_running ()
 
 ############################################################
 
+# If necessary, mount volatile database directory on tmpfs
+dbdir_tmpfs_start ()
+{
+    if [ -z "$CTDB_DBDIR_TMPFS_OPTIONS" ] ; then
+	return
+    fi
+
+    # Shortcut for readability
+    _opts="$CTDB_DBDIR_TMPFS_OPTIONS"
+
+    mkdir -p "$CTDB_DBDIR" || exit $?
+
+    # If already mounted then remount, otherwise mount
+    if findmnt -t tmpfs "$CTDB_DBDIR" >/dev/null ; then
+	mount -t tmpfs -o "remount,$_opts" none "$CTDB_DBDIR" || \
+	    exit $?
+    else
+	mount -t tmpfs -o "$_opts" none "$CTDB_DBDIR" || exit $?
+    fi
+}
+
+# If necessary, unmount volatile database tmpfs directory on exit
+dbdir_tmpfs_stop ()
+{
+    if [ -z "$CTDB_DBDIR_TMPFS_OPTIONS" ] ; then
+	return
+    fi
+
+    if [ -d "$CTDB_DBDIR" ] && findmnt -t tmpfs "$CTDB_DBDIR" >/dev/null ; then
+	umount "$CTDB_DBDIR"
+    fi
+}
+
 build_ctdb_options ()
 {
     ctdb_options=""
@@ -114,6 +147,7 @@ build_ctdb_options ()
     maybe_set "--logfile"                "$CTDB_LOGFILE"
     maybe_set "--nlist"                  "$CTDB_NODES"
     maybe_set "--socket"                 "$CTDB_SOCKET"
+    maybe_set "--listen"                 "$CTDB_NODE_ADDRESS"
     maybe_set "--public-addresses"       "$CTDB_PUBLIC_ADDRESSES"
     maybe_set "--public-interface"       "$CTDB_PUBLIC_INTERFACE"
     maybe_set "--dbdir"                  "$CTDB_DBDIR"
@@ -167,6 +201,8 @@ start()
     # will be, so this can really do no harm.
     kill_ctdbd "$_session"
 
+    dbdir_tmpfs_start
+
     build_ctdb_options
 
     export_debug_variables
@@ -239,25 +275,33 @@ stop()
     # Wait for remaining CTDB processes to exit...
     _timeout=${CTDB_SHUTDOWN_TIMEOUT:-30}
     _count=0
+    _terminated=false
     while [ $_count -lt $_timeout ] ; do


-- 
CTDB repository



More information about the samba-cvs mailing list