]> www.infradead.org Git - users/hch/xfsprogs.git/commit
xfs_repair: don't zero the incore secondary super when zeroing
authorDarrick J. Wong <djwong@kernel.org>
Tue, 16 Aug 2022 23:56:14 +0000 (16:56 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 22 Nov 2023 23:03:31 +0000 (15:03 -0800)
commitf74ed98c92cb5dc82d3871aaecb1cf5f67c044f0
tree9a964436f2a1b703f3339b0c6a8bdd6cfb15719b
parenta5db3a2b508f0de8c28ee68dfa3a850ad78a869a
xfs_repair: don't zero the incore secondary super when zeroing

If secondary_sb_whack detects nonzero bytes beyond the end of the ondisk
superblock, it will try to zero the end of the ondisk buffer as well as
the incore superblock prior to scan_ag using that incore super to
rewrite the ondisk super.

However, the metadata directory feature adds a sb_metadirino field to
the incore super.  On disk, this is stored in the same slot as
sb_rbmino, but we wanted to cache both inumbers incore to minimize the
churn.  Therefore, it is now only safe to zero the "end" of an xfs_dsb
buffer, and never an xfs_sb object.

Most of the XFS codebase moved off that second behavior long ago, with
the exception of this one part of repair.  The zeroing probably ought to
be turned into explicit logic to zero fields that weren't defined with
the featureset encoded in the primary superblock, but for now we'll
resort to always resetting the values from the xfs_mount's xfs_sb.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
repair/agheader.c