Skip to content
  • Lai Siyao's avatar
    LU-4684 lmv: support accessing migrating directory · 976b609a
    Lai Siyao authored
    
    
    Migrating directory contains stripes of both old and new layout, and
    its sub files may be located on either one. To avoid race between
    access and new creations, there are 4 rules to access migrating
    directory:
    1. always create new file under new layout.
    2. any operation that tries to create new file under old layout will
       be rejected, e.g., 'mv a <migrating_dir>/b', if b exists and is
       under old layout, this rename should fail with -EBUSY.
    3. operations that access file by name should try old layout first,
       if file doesn't exist, then it will retry new layout, such
       operations include: lookup, getattr_name, unlink, open-by-name,
       link, rename.
    4. according to rule 1, open(O_CREAT | O_EXCL) and create() will
       create new file under new layout, but they should check existing
       file in one transaction, however this can't be done for old
       layout, so check existing file under old layout on client side,
       then issue the open/create request to new layout.
    
    Disable sanity 230d for ZFS backend because it will trigger lots of
    sync, which may cause system hung.
    
    Signed-off-by: default avatarLai Siyao <lai.siyao@whamcloud.com>
    Change-Id: Icd587eb17f4c6dc2234dcc3c7ba40759bc3e8d31
    Reviewed-on: https://review.whamcloud.com/31504
    
    
    Tested-by: Jenkins
    Tested-by: default avatarMaloo <hpdd-maloo@intel.com>
    Reviewed-by: default avatarFan Yong <fan.yong@intel.com>
    Reviewed-by: default avatarAndreas Dilger <adilger@whamcloud.com>
    Reviewed-by: default avatarOleg Drokin <green@whamcloud.com>
    976b609a