linux-stable/fs/xfs/libxfs
Darrick J. Wong ea01221f95 xfs: remove conditional building of rt geometry validator functions
commit 881f78f472 upstream.

[backport: resolve merge conflicts due to refactoring rtbitmap/summary
macros and accessors]

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: e14293803f ("xfs: don't allow overly small or large realtime volumes")
Fixes: a6a38f309a ("xfs: make rextslog computation consistent with mkfs")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-04-03 15:28:49 +02:00
..
xfs_ag.c xfs: fix perag leak when growfs fails 2024-04-03 15:28:48 +02:00
xfs_ag.h xfs: fix perag leak when growfs fails 2024-04-03 15:28:48 +02:00
xfs_ag_resv.c
xfs_ag_resv.h
xfs_alloc.c xfs: fix internal error from AGFL exhaustion 2024-02-16 19:10:45 +01:00
xfs_alloc.h
xfs_alloc_btree.c
xfs_alloc_btree.h
xfs_attr.c xfs: reset XFS_ATTR_INCOMPLETE filter on node removal 2024-04-03 15:28:49 +02:00
xfs_attr.h
xfs_attr_leaf.c
xfs_attr_leaf.h
xfs_attr_remote.c
xfs_attr_remote.h
xfs_attr_sf.h
xfs_bit.c
xfs_bit.h
xfs_bmap.c xfs: ensure logflagsp is initialized in xfs_bmap_del_extent_real 2024-04-03 15:28:48 +02:00
xfs_bmap.h
xfs_bmap_btree.c
xfs_bmap_btree.h
xfs_btree.c
xfs_btree.h
xfs_btree_staging.c xfs: force all buffers to be written during btree bulk load 2024-04-03 15:28:48 +02:00
xfs_btree_staging.h xfs: remove unused fields from struct xbtree_ifakeroot 2024-04-03 15:28:47 +02:00
xfs_cksum.h
xfs_da_btree.c xfs: update dir3 leaf block metadata after swap 2024-04-03 15:28:49 +02:00
xfs_da_btree.h
xfs_da_format.h
xfs_defer.c xfs: use xfs_defer_pending objects to recover intent items 2024-04-03 15:28:46 +02:00
xfs_defer.h xfs: use xfs_defer_pending objects to recover intent items 2024-04-03 15:28:46 +02:00
xfs_dir2.c
xfs_dir2.h
xfs_dir2_block.c
xfs_dir2_data.c
xfs_dir2_leaf.c
xfs_dir2_node.c
xfs_dir2_priv.h
xfs_dir2_sf.c
xfs_dquot_buf.c
xfs_errortag.h
xfs_format.h xfs: convert rt bitmap extent lengths to xfs_rtbxlen_t 2024-04-03 15:28:46 +02:00
xfs_fs.h
xfs_health.h
xfs_ialloc.c
xfs_ialloc.h
xfs_ialloc_btree.c
xfs_ialloc_btree.h
xfs_iext_tree.c
xfs_inode_buf.c xfs: inode recovery does not validate the recovered inode 2024-02-16 19:10:45 +01:00
xfs_inode_buf.h
xfs_inode_fork.c
xfs_inode_fork.h
xfs_log_format.h
xfs_log_recover.h xfs: transfer recovered intent item ownership in ->iop_recover 2024-04-03 15:28:47 +02:00
xfs_log_rlimit.c
xfs_quota_defs.h
xfs_refcount.c
xfs_refcount.h
xfs_refcount_btree.c
xfs_refcount_btree.h
xfs_rmap.c
xfs_rmap.h
xfs_rmap_btree.c
xfs_rmap_btree.h
xfs_rtbitmap.c xfs: remove conditional building of rt geometry validator functions 2024-04-03 15:28:49 +02:00
xfs_rtbitmap.h xfs: remove conditional building of rt geometry validator functions 2024-04-03 15:28:49 +02:00
xfs_sb.c xfs: remove conditional building of rt geometry validator functions 2024-04-03 15:28:49 +02:00
xfs_sb.h xfs: remove conditional building of rt geometry validator functions 2024-04-03 15:28:49 +02:00
xfs_shared.h
xfs_symlink_remote.c
xfs_trans_inode.c
xfs_trans_resv.c
xfs_trans_resv.h
xfs_trans_space.h
xfs_types.c
xfs_types.h xfs: remove conditional building of rt geometry validator functions 2024-04-03 15:28:49 +02:00