]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs_repair: don't fail on INCOMPLETE attrs in leaf blocks
authorDarrick J. Wong <djwong@kernel.org>
Sat, 14 Mar 2026 15:57:26 +0000 (08:57 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 23 Mar 2026 18:38:18 +0000 (11:38 -0700)
commiteb06f16ca2e9dc3f90280d8497c4aa1180803a3d
tree12e2ab3472b60a7daccf8de9c2a60d08cb8c8564
parent2dd2852fd91b48217f91f8205788f09586e95f46
xfs_repair: don't fail on INCOMPLETE attrs in leaf blocks

While trying to fix problems in generic/753, I noticed test failures on
account of xfs_repair:

 attribute entry #4 in attr block 0, inode 131 is INCOMPLETE
 problem with attribute contents in inode 131
 would clear attr fork
 bad nblocks 4 for inode 131, would reset to 0
 bad anextents 1 for inode 131, would reset to 0

Looking at the dumped filesystem, inode 131 is a linked file, and the
"incomplete" xattr was clearly part of an xfs_attr_set operation that
failed midway through because the induced log shutdown prevented xfs
from finishing the creation of a remote xattr.  This kind of thing is
expected, but instead xfs_repair deletes the entire attr fork!

It's far too drastic to delete every xattr because doing that destroys
things like security labels.  The kernel won't show incomplete attrs so
it's not a big deal to leave them attached to the file.  Note that
xfs_scrub can fix such things.

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