Skip to content
  • Dave Chinner's avatar
    xfs: swalloc doesn't align allocations properly · 33177f05
    Dave Chinner authored
    
    
    When swalloc is specified as a mount option, allocations are
    supposed to be aligned to the stripe width rather than the stripe
    unit of the underlying filesystem. However, it does not do this.
    
    What the implementation does is round up the allocation size to a
    stripe width, hence ensuring that all allocations span a full stripe
    width. It does not, however, ensure that that allocation is aligned
    to a stripe width, and hence the allocations can span multiple
    underlying stripes and so still see RMW cycles for things like
    direct IO on MD RAID.
    
    So, if the swalloc mount option is set, change the allocation
    alignment in xfs_bmap_btalloc() to use the stripe width rather than
    the stripe unit.
    
    Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Reviewed-by: default avatarBen Myers <bpm@sgi.com>
    Signed-off-by: default avatarBen Myers <bpm@sgi.com>
    33177f05