• Darrick J. Wong's avatar
    xfs: remove conditional building of rt geometry validator functions · 881f78f4
    Darrick J. Wong authored
    I mistakenly turned off CONFIG_XFS_RT in the Kconfig file for arm64
    variant of the djwong-wtf git branch.  Unfortunately, it took me a good
    hour to figure out that RT wasn't built because this is what got printed
    to dmesg:
    
    XFS (sda2): realtime geometry sanity check failed
    XFS (sda2): Metadata corruption detected at xfs_sb_read_verify+0x170/0x190 [xfs], xfs_sb block 0x0
    
    Whereas I would have expected:
    
    XFS (sda2): Not built with CONFIG_XFS_RT
    XFS (sda2): RT mount failed
    
    The root cause of these problems is the conditional compilation of the
    new functions xfs_validate_rtextents and xfs_compute_rextslog that I
    introduced in the two commits listed below.  The !RT versions of these
    functions return false and 0, respectively, which causes primary
    superblock validation to fail, which explains the first message.
    
    Move the two functions to other parts of libxfs that are not
    conditionally defined by CONFIG_XFS_RT and remove the broken stubs so
    that validation works again.
    
    Fixes: e1429380 ("xfs: don't allow overly small or large realtime volumes")
    Fixes: a6a38f30 ("xfs: make rextslog computation consistent with mkfs")
    Signed-off-by: default avatar"Darrick J. Wong" <djwong@kernel.org>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
    881f78f4
xfs_rtbitmap.h 9.69 KB