]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
repair: update extent count after zapping duplicate blocks
authorChristoph Hellwig <hch@infradead.org>
Thu, 2 Feb 2012 12:39:10 +0000 (07:39 -0500)
committerChristoph Hellwig <hch@lst.de>
Sun, 5 Feb 2012 14:00:34 +0000 (14:00 +0000)
commite1f43b4c701b24d9b5bc85df858a8c36f0f0723b
tree7ed0961d2828b9ac4580b059e7ba33d3bc6bd36a
parent3269a51a55841c98540709dda2beb2a73f96ef50
repair: update extent count after zapping duplicate blocks

When we find a duplicate extent in an extern format inode we do not zap
the whole inode, but just truncate it to the point where the duplicate
extent was found.  But the current code only updates di_nblocks for the
new size, but no di_nextents/di_anextents.  In most cases this isn't noticed,
but when moving such an inode to the lost+found directoy the consistency
check in xfs_iformat trips over it.  Fix this by updating the on-disk
extent count as part of the inode repair.

Note that we zap btree format inodes with duplicate block completely
at this point, so this fix doesn't apply to them.

Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Reported-by: Arkadiusz Mi??kiewicz <arekm@maven.pl>
Tested-by: Arkadiusz Mi??kiewicz <arekm@maven.pl>
Signed-off-by: Christoph Hellwig <hch@lst.de>
repair/dinode.c
repair/dinode.h
repair/scan.c