]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs_scrub: fix missing scrub coverage for broken inodes
authorDarrick J. Wong <djwong@kernel.org>
Mon, 29 Jul 2024 23:23:03 +0000 (16:23 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 30 Jul 2024 00:01:06 +0000 (17:01 -0700)
commit19a29755bdc3d77be13278ce45e997a7e58ca998
treeaa1f086d8ba1edd9376d897374d39614ffbc367e
parent4b959abc5f353123775973cd98c94d819cc9de79
xfs_scrub: fix missing scrub coverage for broken inodes

If INUMBERS says that an inode is allocated, but BULKSTAT skips over the
inode and BULKSTAT_SINGLE errors out when loading the inumber, there are
two possibilities: One, we're racing with ifree; or two, the inode is
corrupt and iget failed.

When this happens, the scrub_scan_all_inodes code will insert a dummy
bulkstat record with all fields zeroed except bs_ino and bs_blksize.
Hence the use of i_mode switches in phase3 to schedule file content
scrubbing are not entirely correct -- bs_mode==0 means "type unknown",
which ought to mean "schedule all scrubbers".

Unfortunately, the current code doesn't do that, so instead we schedule
no content scrubs.  If the broken file was actually a directory, we fail
to check the directory contents for further corruptions.

Found by using fuzzing with xfs/385 and core.format = 0.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
scrub/phase3.c