linux-stable/fs/xfs/scrub
Darrick J. Wong 881f78f472 xfs: remove conditional building of rt geometry validator functions
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>
2024-01-30 14:04:43 +05:30
..
agb_bitmap.c xfs: move the per-AG datatype bitmaps to separate files 2023-12-15 10:03:30 -08:00
agb_bitmap.h xfs: move the per-AG datatype bitmaps to separate files 2023-12-15 10:03:30 -08: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: roll the scrub transaction after completing a repair 2023-12-15 10:03:31 -08:00
alloc.c xfs: repair free space btrees 2023-12-15 10:03:32 -08:00
alloc_repair.c xfs: repair free space btrees 2023-12-15 10:03:32 -08:00
attr.c xfs: remove struct xfs_attr_shortform 2023-12-29 13:37:05 +05:30
attr.h xfs: check used space of shortform xattr structures 2023-04-11 19:00:33 -07:00
bitmap.c xfs: move the per-AG datatype bitmaps to separate files 2023-12-15 10:03:30 -08:00
bitmap.h xfs: move the per-AG datatype bitmaps to separate files 2023-12-15 10:03:30 -08:00
bmap.c xfs: repair inode fork block mapping data structures 2023-12-15 10:03:39 -08:00
bmap_repair.c xfs: repair the inode core and forks of a metadata inode 2023-12-15 10:03:42 -08: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: abort directory parent scrub scans if we encounter a zapped directory 2023-12-15 10:03:37 -08:00
common.h xfs: repair inode fork block mapping data structures 2023-12-15 10:03:39 -08:00
cow_repair.c xfs: repair problems in CoW forks 2023-12-15 10:03:40 -08: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: abort directory parent scrub scans if we encounter a zapped directory 2023-12-15 10:03:37 -08:00
dqiterate.c xfs: improve dquot iteration for scrub 2023-12-15 10:03:45 -08:00
fsb_bitmap.h xfs: reintroduce reaping of file metadata blocks to xrep_reap_extents 2023-12-15 10:03:38 -08:00
fscounters.c xfs: move the xfs_rtbitmap.c declarations to xfs_rtbitmap.h 2023-10-17 16:24:22 -07:00
health.c xfs/health: cleanup, remove duplicated including 2023-12-22 11:14:17 +05:30
health.h xfs: set inode sick state flags when we zap either ondisk fork 2023-12-15 10:03:35 -08:00
ialloc.c xfs: repair inode btrees 2023-12-15 10:03:32 -08:00
ialloc_repair.c xfs: repair inode btrees 2023-12-15 10:03:32 -08:00
inode.c xfs: repair inode records 2023-12-15 10:03:36 -08:00
inode_repair.c xfs: remove struct xfs_attr_shortform 2023-12-29 13:37:05 +05:30
newbt.c xfs: repair free space btrees 2023-12-15 10:03:32 -08:00
newbt.h xfs: repair free space btrees 2023-12-15 10:03:32 -08:00
off_bitmap.h xfs: repair problems in CoW forks 2023-12-15 10:03:40 -08:00
parent.c xfs: abort directory parent scrub scans if we encounter a zapped directory 2023-12-15 10:03:37 -08:00
quota.c xfs: repair quotas 2023-12-15 10:03:45 -08:00
quota.h xfs: repair quotas 2023-12-15 10:03:45 -08:00
quota_repair.c xfs: repair quotas 2023-12-15 10:03:45 -08:00
readdir.c xfs: make if_data a void pointer 2023-12-29 13:37:03 +05:30
readdir.h xfs: streamline the directory iteration code for scrub 2023-04-11 19:00:17 -07:00
reap.c xfs: repair problems in CoW forks 2023-12-15 10:03:40 -08:00
reap.h xfs: reintroduce reaping of file metadata blocks to xrep_reap_extents 2023-12-15 10:03:38 -08:00
refcount.c xfs: repair refcount btrees 2023-12-15 10:03:33 -08:00
refcount_repair.c xfs: repair refcount btrees 2023-12-15 10:03:33 -08:00
repair.c xfs: repair the inode core and forks of a metadata inode 2023-12-15 10:03:42 -08:00
repair.h xfs: repair quotas 2023-12-15 10:03:45 -08:00
rmap.c xfs: move the per-AG datatype bitmaps to separate files 2023-12-15 10:03:30 -08:00
rtbitmap.c xfs: remove conditional building of rt geometry validator functions 2024-01-30 14:04:43 +05:30
rtbitmap.h xfs: online repair of realtime bitmaps 2023-12-15 10:03:43 -08:00
rtbitmap_repair.c xfs: online repair of realtime bitmaps 2023-12-15 10:03:43 -08:00
rtsummary.c xfs: remove conditional building of rt geometry validator functions 2024-01-30 14:04:43 +05:30
scrub.c xfs: repair quotas 2023-12-15 10:03:45 -08:00
scrub.h xfs: repair inode btrees 2023-12-15 10:03:32 -08: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: make if_data a void pointer 2023-12-29 13:37:03 +05:30
trace.c xfs: repair quotas 2023-12-15 10:03:45 -08:00
trace.h xfs: repair quotas 2023-12-15 10:03:45 -08:00
xfarray.c xfs: improve xfarray quicksort pivot 2023-08-10 07:48:07 -07:00
xfarray.h xfs: repair free space btrees 2023-12-15 10:03:32 -08: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