linux-stable/fs/xfs/scrub
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
..
agheader.c xfs: teach scrub to check for sole ownership of metadata objects 2023-04-11 19:00:15 -07:00
agheader_repair.c xfs: fix agf_fllast when repairing an empty AGFL 2023-08-10 07:48:11 -07:00
alloc.c xfs: flag free space btree records that could be merged 2023-04-11 19:00:26 -07:00
attr.c xfs: don't load local xattr values during scrub 2023-04-11 19:00:35 -07:00
attr.h xfs: check used space of shortform xattr structures 2023-04-11 19:00:33 -07:00
bitmap.c xfs: use per-AG bitmaps to reap unused AG metadata blocks during repair 2023-08-10 07:48:04 -07:00
bitmap.h xfs: use per-AG bitmaps to reap unused AG metadata blocks during repair 2023-08-10 07:48:04 -07:00
bmap.c xfs: don't check reflink iflag state when checking cow fork 2023-08-10 07:48:13 -07:00
btree.c xfs: teach scrub to check for sole ownership of metadata objects 2023-04-11 19:00:15 -07:00
btree.h overflow: Add struct_size_t() helper 2023-05-26 13:52:19 -07:00
common.c xfs: make xchk_iget safer in the presence of corrupt inode btrees 2024-04-03 15:28:47 +02:00
common.h xfs: make xchk_iget safer in the presence of corrupt inode btrees 2024-04-03 15:28:47 +02:00
dabtree.c xfs: scrub should use ECHRNG to signal that the drain is needed 2023-04-11 19:00:00 -07:00
dabtree.h xfs: update copyright years for scrub/ files 2023-04-11 18:59:57 -07:00
dir.c xfs: manage inode DONTCACHE status at irele time 2023-04-11 19:00:20 -07:00
fscounters.c xfs: move the xfs_rtbitmap.c declarations to xfs_rtbitmap.h 2024-04-03 15:28:46 +02:00
health.c xfs: always rescan allegedly healthy per-ag metadata after repair 2023-08-10 07:48:09 -07:00
health.h xfs: update copyright years for scrub/ files 2023-04-11 18:59:57 -07:00
ialloc.c xfs: rewrite xchk_inode_is_allocated to work properly 2023-08-10 07:48:12 -07:00
inode.c xfs: add missing nrext64 inode flag check to scrub 2024-04-03 15:28:48 +02:00
parent.c xfs: wrap ilock/iunlock operations on sc->ip 2023-08-10 07:48:08 -07:00
quota.c xfs: wrap ilock/iunlock operations on sc->ip 2023-08-10 07:48:08 -07:00
readdir.c xfs: streamline the directory iteration code for scrub 2023-04-11 19:00:17 -07:00
readdir.h xfs: streamline the directory iteration code for scrub 2023-04-11 19:00:17 -07:00
reap.c xfs: fix an off-by-one error in xreap_agextent_binval 2024-04-03 15:28:48 +02:00
reap.h xfs: use per-AG bitmaps to reap unused AG metadata blocks during repair 2023-08-10 07:48:04 -07:00
refcount.c xfs: fix duplicate includes 2023-04-20 08:18:34 +10:00
repair.c xfs: track usage statistics of online fsck 2023-08-10 07:48:07 -07:00
repair.h xfs: track usage statistics of online fsck 2023-08-10 07:48:07 -07:00
rmap.c xfs: cross-reference rmap records with refcount btrees 2023-04-11 19:00:39 -07:00
rtbitmap.c xfs: remove conditional building of rt geometry validator functions 2024-04-03 15:28:49 +02:00
rtsummary.c xfs: remove conditional building of rt geometry validator functions 2024-04-03 15:28:49 +02:00
scrub.c xfs: only call xchk_stats_merge after validating scrub inputs 2023-09-12 10:31:08 -07:00
scrub.h New code for 6.6: 2023-08-30 12:34:12 -07:00
stats.c xfs: only call xchk_stats_merge after validating scrub inputs 2023-09-12 10:31:08 -07:00
stats.h xfs: track usage statistics of online fsck 2023-08-10 07:48:07 -07:00
symlink.c xfs: update copyright years for scrub/ files 2023-04-11 18:59:57 -07:00
trace.c xfs: create a big array data structure 2023-08-10 07:48:04 -07:00
trace.h xfs: convert rt bitmap extent lengths to xfs_rtbxlen_t 2024-04-03 15:28:46 +02:00
xfarray.c xfs: improve xfarray quicksort pivot 2023-08-10 07:48:07 -07:00
xfarray.h xfs: improve xfarray quicksort pivot 2023-08-10 07:48:07 -07:00
xfile.c xfs: Remove duplicate include 2023-10-12 10:14:45 +05:30
xfile.h xfs: cache pages used for xfarray quicksort convergence 2023-08-10 07:48:06 -07:00
xfs_scrub.h xfs: update copyright years for scrub/ files 2023-04-11 18:59:57 -07:00