XFS online scrub gets 21st batch of LLM-assisted repair fixes
Darrick J. Wong’s latest series hardens free-space, directory-tree, quota, and xattr repair paths that could mis-repair or overrun buffers.
XFS maintainer Darrick J. Wong has posted a twenty-first batch of fixes for the filesystem’s online scrub and repair code, again crediting large-language-model assistance for spotting the defects. The changes are aimed at stable kernels as well as mainline, covering bugs that could leave repairs incomplete, corrupt quota state, or walk past the end of attribute buffers.
Several of the more serious problems sit in the repair path itself. Directory-tree repair could keep going after live-update hooks had already failed, risking an incorrect fix. A related check flattened errors from broken parent pointers into success, so scrub could hand a half-finished scan to repair; the code now marks the run incomplete and stops. Free-space btree rebuilds double-counted unused blocks when updating allocation-group counters, and long rmap walks did not check for fatal signals often enough, which made xfs_scrub slow to respond to interruption.
Quota and inode repair received multiple corrections. Changing a file’s user, group, or project id left stale in-core dquots attached; the fix detaches them and schedules a quotacheck. Repair of quota files no longer resets the default (id-zero) timer, and conversion of unwritten extents in a quota inode’s data fork now zeroes on-disk contents, resynchronizes the extent cursor after the tree changes shape, and forces a quotacheck when an on-disk dquot is reset. Inode repair setup failures that were previously discarded are now reported.
Attribute scrub tightened bounds checks so leaf entries that start too close to the end of a buffer cannot overrun it, and absurdly large value lengths are rejected early instead of forcing huge allocations. Scrub tracepoints also gained range checks before indexing btree cursor levels, avoiding out-of-range access when logging corruption. Supporting bitmap helpers document zero-length and self-disunion behaviour that had been underspecified.
Christoph Hellwig reviewed most of the series. Wong advised anyone running the new code to pull from his XFS trees rather than stacking patches ad hoc.