gfs2-utils: master - fsck.gfs2: segfault in pass1b

Bob Peterson rpeterso at fedoraproject.org
Tue Feb 22 22:07:12 UTC 2011


Gitweb:        http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=4e79f08f455038bdfb962f941676b7d5d8c21ef8
Commit:        4e79f08f455038bdfb962f941676b7d5d8c21ef8
Parent:        897437313adc8801b38ea42abc4fd07bd486ce3e
Author:        Bob Peterson <rpeterso at redhat.com>
AuthorDate:    Tue Feb 22 15:56:39 2011 -0600
Committer:     Bob Peterson <rpeterso at redhat.com>
CommitterDate: Tue Feb 22 15:56:39 2011 -0600

fsck.gfs2: segfault in pass1b

The problem occurred when there were duplicate block
references in a dinode but all references in the duplicate
list are eventually deleted due to other corruption.
The fix is an additional check whether the list is empty.

rhbz#679076
---
 gfs2/fsck/pass1b.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
index 090b412..5bbda7c 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -542,7 +542,7 @@ static int handle_dup_blk(struct gfs2_sbd *sbp, struct duptree *b)
 		last_reference = clear_a_reference(sbp, b, &b->ref_inode_list,
 						   &dh, 0);
 
-	if (last_reference) {
+	if (last_reference && !osi_list_empty(&b->ref_inode_list)) {
 		uint8_t q;
 
 		/* If we're down to a single reference (and not all references


More information about the cluster-commits mailing list