OpenAFS Master Repository branch, master, updated. openafs-devel-1_5_76-4114-g7f58e4a

Gerrit Code Review gerrit@openafs.org
Mon, 27 Jan 2014 17:53:38 -0800 (PST)


The following commit has been merged in the master branch:
commit 7f58e4ac454f9c06fb2d51ff0a17b8656c454efe
Author: Andrew Deason <adeason@sinenomine.net>
Date:   Fri Dec 20 12:16:37 2013 -0600

    afs: Return raw code from background daemons
    
    Currently, a background daemon processing a 'store' request will
    return any error code in the 'code' field in the brequest structure,
    for processing by anyone that's waiting for the response. Since any
    waiter will not have access to the treq for the request, they won't be
    able to call afs_CheckCode on that return code, so the background
    daemon calls afs_CheckCode before returning its error code.
    
    Currently, afs_close uses the 'code' value from the background daemon
    as if it were not passed through afs_CheckCode. That is, if all
    background daemons are busy, we get our 'code' directly from
    afs_StoreOnLastReference, and if we use a background daemon, our
    'code' is tb->code. But these values are two different things: the
    return value from afs_StoreOnLastReference is a raw error code, and
    the code from the background daemon (tb->code) has been translated
    through afs_CheckCode.
    
    This can be confusing, in particular for the scenario where a
    StoreData fails because of network errors or because of a VBUSY error.
    If we get a network error when the request went through a background
    daemon, afs_CheckCode will translate this to ETIMEDOUT, which is
    commonly value 110, the same as VBUSY. So, an ETIMEDOUT error from the
    background daemon is difficult to distinguish from a VBUSY error from
    a direct afs_StoreOnLastReference call. Either case can result in a
    message to the kernel like the following:
    
      afs: failed to store file (110)
    
    To resolve this, have the background daemon store both the 'raw' error
    code, and the error code that has been translated through
    afs_CheckCode. afs_close can then use the raw error code when
    reporting messages like normal, but can still use the translated error
    code to return to the caller, if it has a translated error. With this
    change, now afs_close will always log "network problems" for a network
    error, regardless of if the error came in via a background daemon or a
    direct afs_StoreOnLastReference call.
    
    In Irix's afs_delmap, we just remove the old usage of tb->code, since
    the result was not used for anything.
    
    Change-Id: I3e2bf7e36c1f098df16a1fdb0dc88b45ea87dfa9
    Reviewed-on: http://gerrit.openafs.org/10633
    Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
    Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
    Tested-by: BuildBot <buildbot@rampaginggeek.com>

 src/afs/IRIX/osi_vnodeops.c    |    1 -
 src/afs/VNOPS/afs_vnop_write.c |   12 ++++++++++--
 src/afs/afs.h                  |    3 ++-
 src/afs/afs_daemons.c          |   17 ++++++++++++++---
 src/afs/afs_dcache.c           |    2 +-
 5 files changed, 27 insertions(+), 8 deletions(-)

-- 
OpenAFS Master Repository