OpenAFS Master Repository branch, openafs-stable-1_6_x, updated. openafs-stable-1_6_0pre1-18-g22bb66c

Gerrit Code Review gerrit@openafs.org
Mon, 10 Jan 2011 12:26:07 -0800 (PST)


The following commit has been merged in the openafs-stable-1_6_x branch:
commit 22bb66ca73f98a7786aac79f1600b374e927addc
Author: Simon Wilkinson <sxw@your-file-system.com>
Date:   Sun Dec 26 14:14:38 2010 +0000

    volser: Fix broken bulk conversion
    
    The converstions between the original, N and U bulk list return
    values were all broken in various ways:
    
    1/ Shifting from malloc to xdr_alloc() (in 4f1efdc8b73ed)
       subtly changed the behaviour when handling an empty list. The
       correct XDR representation of an empty list is {0, NULL}, not
       {0, &memZero}. Fix the code so that if the source list is empty,
       an empty destination list is returned.
    2/ The destination list length was never being filled in. This means
       that xdr_free() could not be safely used on this list, as the wrong
       length would be passed to the allocator. Fill in the destination
       list length as part of the conversion.
    3/ xdr_free(...) is a no-op when called with an empty list - there's
       no need to check before calling it. Remove these checks to improve
       the code's readability.
    4/ xdr_free(...) should only be called when the RPC returned
       sucessfully. The stub is responsible for freeing data should the call
       fail mid way through unmarshalling.
    5/ Where an RPC returns the number of entries independently of the
       length of a counted array, it is unsafe to use that length to
       iterate the array without checking that it is within the array
       bounds. Instead, just use the array length when performing
       conversions.
    
    Reviewed-on: http://gerrit.openafs.org/3596
    Reviewed-by: Derrick Brashear <shadow@dementia.org>
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    (cherry picked from commit 02a2f6005042b9370350bdc03d4aab83355b205d)
    
    Change-Id: I1d3ec3929a8974d571e9b3712e53db4fceab4879
    Reviewed-on: http://gerrit.openafs.org/3635
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    Reviewed-by: Derrick Brashear <shadow@dementia.org>
    Tested-by: Derrick Brashear <shadow@dementia.org>

 src/volser/vsutils.c |   74 ++++++++++++++++++++++++++++++-------------------
 1 files changed, 45 insertions(+), 29 deletions(-)

-- 
OpenAFS Master Repository