OpenAFS Master Repository branch, openafs-stable-1_6_x, updated. openafs-stable-1_6_1pre2-24-gf44fb4f

Gerrit Code Review gerrit@openafs.org
Thu, 23 Feb 2012 09:35:15 -0800 (PST)


The following commit has been merged in the openafs-stable-1_6_x branch:
commit f44fb4f5f87968dac47d9a6c42eea3e41ee8405c
Author: Andrew Deason <adeason@sinenomine.net>
Date:   Fri Feb 17 13:14:31 2012 -0600

    viced: Correctly update addrs on alt addr probe
    
    The functions MultiBreakCallBackAlternateAddress_r and
    MultiProbeAlternateAddress_r try to find a valid address in a host's
    interface list of addrs. If they find one, they update host->host and
    host->port. However, they do so just by changing those fields directly
    and by calling h_DeleteHostFromAddrHashTable_r and
    h_AddHostToAddrHashTable_r. This leaves the old host->host, host->port
    on the interface list, and leaves it marked as 'valid'. Similarly, the
    new host and port may still be marked as not 'valid'.
    
    This can result in the host being on the addr hash table via an
    address that is not on the host's interface list. After the above
    situation occurs, we may call
    
      removeInterfaceAddr_r(host, host->host, host->port);
    
    and then update host->host and host->port, which happens in a variety
    of places. Since host->host, host->port is not marked as valid in the
    interface list, it is not removed from the addr hash table, but it is
    removed from the interface list. Eventually, this can cause the host
    to be referenced from the addr hash table even after it has been
    freed.
    
    Since this can result in hash table entries pointing to the 'wrong'
    host, this can result in FileLog messages such as:
    
    Sun Feb  5 03:16:35 2012 Removing address that does not belong to host 0xdeadbeefdead (1.2.3.4:7001).
    
    And bogus instances of the message:
    
    Sun Feb  5 03:16:36 2012 CB: new identity for host 0xdeadbeefdead (1.2.3.4:7001), deleting(1 baadcafe 12345678-9abc-def0-12-34-456789abcdef fedcba98-76543210f-ed-cb-a9876543210f)
    
    To fix this, make MultiBreakCallBackAlternateAddress_r and
    MultiProbeAlternateAddress_r update the address list the same way as
    all of the code in host.c does; by adding the new address with
    addInterfaceAddr_r, removing it with removeInterfaceAddr_r, and
    updating host->host and host->port.
    
    Reviewed-on: http://gerrit.openafs.org/6727
    Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
    Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
    Reviewed-by: Derrick Brashear <shadow@dementix.org>
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    (cherry picked from commit 7a6efc9bfcd955901d19274cc96f9a1b67f54f95)
    
    Change-Id: I3bf82f116bc2dd979e1e93cea58a4c74b0a2023d
    Reviewed-on: http://gerrit.openafs.org/6767
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
    Reviewed-by: Derrick Brashear <shadow@dementix.org>

 src/viced/callback.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

-- 
OpenAFS Master Repository