gfs2-utils: master - fsck.gfs2: Only preserve the _first_ acceptable inode reference

Bob Peterson rpeterso at fedoraproject.org
Tue Sep 29 18:37:58 UTC 2015


Gitweb:        http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=cd7a3ddc01a243bc571dd281a9d70e7b1b4dc8fa
Commit:        cd7a3ddc01a243bc571dd281a9d70e7b1b4dc8fa
Parent:        1849ca24fed43fdc2964b6097dbae9354e3f9f59
Author:        Bob Peterson <rpeterso at redhat.com>
AuthorDate:    Wed Sep 23 12:51:30 2015 -0500
Committer:     Bob Peterson <rpeterso at redhat.com>
CommitterDate: Tue Sep 29 13:23:06 2015 -0500

fsck.gfs2: Only preserve the _first_ acceptable inode reference

Function resolve_dup_references starts out with a loop that traverses
the references for a given duplicate block. If it finds an acceptable
reference, it is supposed to preserve the first reference and resolve
the others. However, the logic allowed for multiple inodes to be
preserved, which can lead to fsck errors that need resolving with yet
another run of fsck.gfs2. This patch adds a check to see if we've
already preserved one, and if so, to not preserve others that might
happen to be acceptable.
---
 gfs2/fsck/pass1b.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
index 845227e..83a506c 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -114,8 +114,7 @@ static void resolve_dup_references(struct gfs2_sbd *sdp, struct duptree *dt,
 		if (acceptable_ref != ref_types && /* If we're nuking all but
 						      an acceptable reference
 						      type and */
-		    this_ref == acceptable_ref && /* this ref is acceptable */
-		    !found_good_ref) { /* We haven't found a good reference */
+		    this_ref == acceptable_ref) { /* this ref is acceptable */
 			/* If this is an invalid inode, but not on the invalid
 			   list, it's better to delete it. */
 			if (q == GFS2_BLKST_DINODE) {


More information about the cluster-commits mailing list