linux/fs/xfs/scrub
Darrick J. Wong c3a22c2e4b xfs: skip the rmapbt search on an empty attr fork unless we know it was zapped
The attribute fork scrubber can optionally scan the reverse mapping
records of the filesystem to determine if the fork is missing mappings
that it should have.  However, this is a very expensive operation, so we
only want to do this if we suspect that the fork is missing records.
For attribute forks the criteria for suspicion is that the attr fork is
in EXTENTS format and has zero extents.

However, there are several ways that a file can end up in this state
through regular filesystem usage.  For example, an LSM can set a
s_security hook but then decide not to set an ACL; or an attr set can
create the attr fork but then the actual set operation fails with
ENOSPC; or we can delete all the attrs on a file whose data fork is in
btree format, in which case we do not delete the attr fork.  We don't
want to run the expensive check for any case that can be arrived at
through regular operations.

However.

When online inode repair decides to zap an attribute fork, it cannot
determine if it is zapping ACL information.  As a precaution it removes
all the discretionary access control permissions and sets the user and
group ids to zero.  Check these three additional conditions to decide if
we want to scan the rmap records.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2023-12-15 10:03:38 -08:00
..
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_repair.c xfs: roll the scrub transaction after completing a repair 2023-12-15 10:03:31 -08:00
agheader.c xfs: teach scrub to check for sole ownership of metadata objects 2023-04-11 19:00:15 -07:00
alloc_repair.c xfs: repair free space btrees 2023-12-15 10:03:32 -08:00
alloc.c xfs: repair free space btrees 2023-12-15 10:03:32 -08: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: 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: skip the rmapbt search on an empty attr fork unless we know it was zapped 2023-12-15 10:03:38 -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: abort directory parent scrub scans if we encounter a zapped directory 2023-12-15 10:03:37 -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
fscounters.c xfs: move the xfs_rtbitmap.c declarations to xfs_rtbitmap.h 2023-10-17 16:24:22 -07:00
health.c xfs: set inode sick state flags when we zap either ondisk fork 2023-12-15 10:03:35 -08:00
health.h xfs: set inode sick state flags when we zap either ondisk fork 2023-12-15 10:03:35 -08:00
ialloc_repair.c xfs: repair inode btrees 2023-12-15 10:03:32 -08:00
ialloc.c xfs: repair inode btrees 2023-12-15 10:03:32 -08:00
inode_repair.c xfs: zap broken inode forks 2023-12-15 10:03:37 -08:00
inode.c xfs: repair inode records 2023-12-15 10:03:36 -08:00
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
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: 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: move the per-AG datatype bitmaps to separate files 2023-12-15 10:03:30 -08: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_repair.c xfs: repair refcount btrees 2023-12-15 10:03:33 -08:00
refcount.c xfs: repair refcount btrees 2023-12-15 10:03:33 -08:00
repair.c xfs: repair inode records 2023-12-15 10:03:36 -08:00
repair.h xfs: repair inode records 2023-12-15 10:03:36 -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: try to attach dquots to files before repairing them 2023-12-15 10:03:34 -08:00
rtsummary.c xfs: try to attach dquots to files before repairing them 2023-12-15 10:03:34 -08:00
scrub.c xfs: repair inode records 2023-12-15 10:03:36 -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: set inode sick state flags when we zap either ondisk fork 2023-12-15 10:03:35 -08:00
trace.c xfs: use accessor functions for summary info words 2023-10-18 16:53:00 -07:00
trace.h xfs: zap broken inode forks 2023-12-15 10:03:37 -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