• Darrick J. Wong's avatar
    xfs: fix integer overflows in the fsmap rtbitmap and logdev backends · 7975aba1
    Darrick J. Wong authored
    It's not correct to use the rmap irec structure to hold query key
    information to query the rtbitmap because the realtime volume can be
    longer than 2^32 fsblocks in length.  Because the rt volume doesn't have
    allocation groups, introduce a daddr-based record filtering algorithm
    and compute the rtextent values using 64-bit variables.  The same
    problem exists in the external log device fsmap implementation, so use
    the same solution to fix it too.
    
    After this patch, all the code that touches info->low and info->high
    under xfs_getfsmap_logdev and __xfs_getfsmap_rtdev are unnecessary.
    Cleaning this up will be done in subsequent patches.
    
    Fixes: 4c934c7d ("xfs: report realtime space information via the rtbitmap")
    Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
    Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
    7975aba1
xfs_fsmap.c 28.1 KB