From: Ben Myers <bpm@sgi.com>
To: xfs@oss.sgi.com
Subject: [PATCH v2] xfs_repair: fix process_bmbt_reclist_int
Date: Tue, 10 Dec 2013 14:53:52 -0600 [thread overview]
Message-ID: <20131210205352.GC1935@sgi.com> (raw)
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>
---
v2: Use error2 instead of shadowing error, as per Dave's suggestion.
repair/dinode.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
Index: b/repair/dinode.c
===================================================================
--- a/repair/dinode.c 2013-12-10 14:42:57.905267321 -0600
+++ b/repair/dinode.c 2013-12-10 14:45:43.435246026 -0600
@@ -663,9 +663,10 @@ _("inode %" PRIu64 " - extent offset too
}
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
@@ -677,7 +678,7 @@ _("inode %" PRIu64 " - extent offset too
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);
}
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next reply other threads:[~2013-12-10 20:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-10 20:53 Ben Myers [this message]
2013-12-10 21:06 ` [PATCH v2] xfs_repair: fix process_bmbt_reclist_int Christoph Hellwig
2013-12-11 15:01 ` Rich Johnston
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131210205352.GC1935@sgi.com \
--to=bpm@sgi.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox