git: hammer2 - Cleanup error paths

Matthew Dillon dillon at crater.dragonflybsd.org
Mon Mar 30 21:57:18 PDT 2015


commit 23c7c7dd4e59da5bdb6ffa7fe2074c5b7ffe5e4f
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Mon Mar 30 21:50:14 2015 -0700

    hammer2 - Cleanup error paths
    
    * Do not try to return I/O error status from hammer2_chain_lock() or
      hammer2_cluster_lock().  This is just asking for trouble by depending
      on callers to keep track of state in local variables.
    
      Instead, accumulate error status in chain->error and cluster->error.
      Adjust cluster->error based on focus.  Code does not yet check this field.
    
    * Do not NULL-out cluster array entries on I/O errors or if unavailable.
      Leave the chain structure intact.
    
      This makes the cluster's array-of-chains more deterministic and will
      allow upcoming code to use errored chains as a placeholder for blocking
      operations.
    
    * When locking a cluster, attempt to select alternative masters or slaves
      for our focus if the chain we would have otherwised used is errored.
    
    * Add inlines to test whether a chain or cluster can be read or written
      (writing still also requires calling *_modify()).
    
    * Document leaving inode->pfs_nmasters set to 0 for new masters.
    
    * Adjust hammer2 pfs-list to display whether a master is a normal
      master or a snapshot.

Summary of changes:
 sbin/hammer2/cmd_pfs.c             |  16 +-
 sbin/newfs_hammer2/newfs_hammer2.c |   5 +
 sys/vfs/hammer2/hammer2.h          |  64 ++++++-
 sys/vfs/hammer2/hammer2_chain.c    |  76 ++++----
 sys/vfs/hammer2/hammer2_cluster.c  | 368 ++++++++-----------------------------
 sys/vfs/hammer2/hammer2_vfsops.c   |   4 +-
 6 files changed, 191 insertions(+), 342 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/23c7c7dd4e59da5bdb6ffa7fe2074c5b7ffe5e4f


-- 
DragonFly BSD source repository


More information about the Commits mailing list