[Cluster-devel] [gfs2-utils PATCH 4/7] fsck.gfs2: Fix infinite loop in pass1b caused by duplicates in hash table

Bob Peterson rpeterso at redhat.com
Tue Jul 16 12:56:11 UTC 2013


If directory leaf blocks appeared more than once in a directory hash
table, the duplicate references would be flagged as a duplicate,
but since the duplicates were all from the same directory dinode,
pass1b would not realize it needed to stop. This patch changes the
criteria for duplicate processing so that it stops when the references
are down to a single dinode, not a single reference. This allows
it to get beyond pass1b so that the problem can be fixed by the hash
table checking code in pass2.

rhbz#984085
---
 gfs2/fsck/pass1b.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
index 0dcb306..e3da20a 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -368,11 +368,11 @@ static int handle_dup_blk(struct gfs2_sbd *sdp, struct duptree *dt)
 	/* If there's still a last remaining reference, and it's a valid
 	   reference, use it to determine the correct block type for our
 	   blockmap and bitmap. */
-	if (dh.ref_count == 1 && !osi_list_empty(&dt->ref_inode_list)) {
+	if (dh.ref_inode_count == 1 && !osi_list_empty(&dt->ref_inode_list)) {
 		uint8_t q;
 
 		log_notice( _("Block %llu (0x%llx) has only one remaining "
-			      "valid reference.\n"),
+			      "valid inode referencing it.\n"),
 			    (unsigned long long)dup_blk,
 			    (unsigned long long)dup_blk);
 		/* If we're down to a single reference (and not all references
-- 
1.8.3.1




More information about the Cluster-devel mailing list