]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
repair: do not walk the unlinked inode list
authorChristoph Hellwig <hch@lst.de>
Wed, 11 Jan 2012 18:51:53 +0000 (18:51 +0000)
committerChristoph Hellwig <hch@lst.de>
Wed, 11 Jan 2012 18:51:53 +0000 (18:51 +0000)
commit62b00e6325060e22b6a749abf0d7fc1ea50b1fd6
tree061039d788124fed58681c142fe28c787b0f5de4
parent66bd6431d0e3b3618c8abacbd6df3fbae74abeec
repair: do not walk the unlinked inode list

Stefan Pfetzing reported a bug where xfs_repair got stuck eating 100% CPU in
phase3.  We track it down to a loop in the unlinked inode list, apparently
caused by memory corruption on an iSCSI target.

I looked into tracking if we already saw a given unlinked inode, but given
that we keep walking even for inodes where we can't find an allocation btree
record that seems infeasible.  On the other hand these inodes had their
final unlink and thus were dead even before the system went down.  There
really is no point in adding them to the uncertain list and looking for
references to them later.

So the simplest fix seems to be to simply remove the unlinked inode list
walk and just clear it - when we rebuild the inode allocation btrees these
will simply be marked free.

Reported-by: Stefan Pfetzing <stefan.pfetzing@1und1.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
repair/phase3.c