• Dave Chinner's avatar
    xfs: Don't wrap growfs AGFL indexes · ad747e3b
    Dave Chinner authored
    Commit 96f859d5 ("libxfs: pack the agfl header structure so
    XFS_AGFL_SIZE is correct") allowed the freelist to use the empty
    slot at the end of the freelist on 64 bit systems that was not
    being used due to sizeof() rounding up the structure size.
    
    This has caused versions of xfs_repair prior to 4.5.0 (which also
    has the fix) to report this as a corruption once the filesystem has
    been grown. Older kernels can also have problems (seen from a whacky
    container/vm management environment) mounting filesystems grown on a
    system with a newer kernel than the vm/container it is deployed on.
    
    To avoid this problem, change the initial free list indexes not to
    wrap across the end of the AGFL, hence avoiding the initialisation
    of agf_fllast to the last index in the AGFL.
    
    cc: <stable@vger.kernel.org> # 4.4-4.5
    Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
    Reviewed-by: default avatarCarlos Maiolino <cmaiolino@redhat.com>
    Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
    ad747e3b
xfs_fsops.c 22.3 KB