• Christoph Hellwig's avatar
    xfs: reinstate delalloc for RT inodes (if sb_rextsize == 1) · 6a94b1ac
    Christoph Hellwig authored
    Commit aff3a9ed ("xfs: Use preallocation for inodes with extsz
    hints") disabled delayed allocation for all inodes with extent size
    hints due a data exposure problem.  It turns out we fixed this data
    exposure problem since by always creating unwritten extents for
    delalloc conversions due to more data exposure problems, but the
    writeback path doesn't actually support extent size hints when
    converting delalloc these days, which probably isn't a problem given
    that people using the hints know what they get.
    
    However due to the way how xfs_get_extsz_hint is implemented, it
    always claims an extent size hint for RT inodes even if the RT
    extent size is a single FSB.  Due to that the above commit effectively
    disabled delalloc support for RT inodes.
    
    Switch xfs_get_extsz_hint to return 0 for this case and work around
    that in a few places to reinstate delalloc support for RT inodes on
    file systems with an sb_rextsize of 1.
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
    Reviewed-by: default avatar"Darrick J. Wong" <djwong@kernel.org>
    Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
    6a94b1ac
xfs_rtalloc.c 38.4 KB