]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair: fix process_bmbt_reclist_int
authorBen Myers <bpm@sgi.com>
Tue, 10 Dec 2013 20:53:52 +0000 (20:53 +0000)
committerRich Johnston <rjohnston@sgi.com>
Wed, 11 Dec 2013 14:55:53 +0000 (08:55 -0600)
There is a set checks for corruption in block map btrees in
process_bmbt_reclist_int that we identify but currently do not fix.  It
appears that the author's intent in this function was to set error = 1,
and then only clear it when all of the checks were completed
successfully.  Unfortunately error can be cleared when it is used for
the return value of blkmap_set_ext.  Some kinds of corruption are not
being fixed, including duplicate extents, claiming free blocks, claiming
metadata blocks, and multiply used blocks.

Fix this by using error2 for the return code from blkmap_set_ext.

Signed-off-by: Ben Myers <bpm@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
repair/dinode.c

index 7469fc816897c5da2ab4c1516e0aff5ff6ba5588..3115bd0d66ff84e3aae7e550b10d53eb20db625c 100644 (file)
@@ -651,9 +651,10 @@ _("inode %" PRIu64 " - extent offset too large - start %" PRIu64 ", "
                }
 
                if (blkmapp && *blkmapp) {
-                       error = blkmap_set_ext(blkmapp, irec.br_startoff,
+                       int     error2;
+                       error2 = blkmap_set_ext(blkmapp, irec.br_startoff,
                                        irec.br_startblock, irec.br_blockcount);
-                       if (error) {
+                       if (error2) {
                                /*
                                 * we don't want to clear the inode due to an
                                 * internal bmap tracking error, but if we've
@@ -665,7 +666,7 @@ _("inode %" PRIu64 " - extent offset too large - start %" PRIu64 ", "
                                do_abort(
 _("Fatal error: inode %" PRIu64 " - blkmap_set_ext(): %s\n"
   "\t%s fork, off - %" PRIu64 ", start - %" PRIu64 ", cnt %" PRIu64 "\n"),
-                                       ino, strerror(error), forkname,
+                                       ino, strerror(error2), forkname,
                                        irec.br_startoff, irec.br_startblock,
                                        irec.br_blockcount);
                        }