public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* gfs1-utils: master - Fix block count in pass1b.
@ 2009-04-06  1:41 Bob Peterson
  0 siblings, 0 replies; only message in thread
From: Bob Peterson @ 2009-04-06  1:41 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/gfs1-utils.git?p=gfs1-utils.git;a=commitdiff;h=e45ae8a00674c0d37e21a0094e77562e223aa7f6
Commit:        e45ae8a00674c0d37e21a0094e77562e223aa7f6
Parent:        3481e376f15903e00c9f565df46d7ad6849ff940
Author:        Bob Peterson <rpeterso@redhat.com>
AuthorDate:    Sun Apr 5 20:38:57 2009 -0500
Committer:     Bob Peterson <rpeterso@redhat.com>
CommitterDate: Sun Apr 5 20:38:57 2009 -0500

Fix block count in pass1b.

bz 493727 -  GFS: gfs_fsck can delete everything in a corrupt file system

When duplicate blocks are discovered by gfs_fsck, the block count
was not being saved by the duplicate processing code.  That caused
the fsck to think there were zero blocks in the directory.  The
descrepency caused the whole root directory to be deleted.
---
 gfs/gfs_fsck/pass1b.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/gfs/gfs_fsck/pass1b.c b/gfs/gfs_fsck/pass1b.c
index 39d437d..9f32aa6 100644
--- a/gfs/gfs_fsck/pass1b.c
+++ b/gfs/gfs_fsck/pass1b.c
@@ -125,6 +125,8 @@ static int find_dentry(struct fsck_inode *ip, struct gfs_dirent *de,
 	osi_list_t *tmp1, *tmp2;
 	struct blocks *b;
 	struct inode_with_dups *id;
+	struct gfs_leaf leaf;
+
 	osi_list_foreach(tmp1, &ip->i_sbd->dup_list) {
 		b = osi_list_entry(tmp1, struct blocks, list);
 		osi_list_foreach(tmp2, &b->ref_inode_list) {
@@ -149,6 +151,10 @@ static int find_dentry(struct fsck_inode *ip, struct gfs_dirent *de,
 			}
 		}
 	}
+	/* Return the number of leaf entries so metawalk doesn't flag this
+	   leaf as having none. */
+	gfs_leaf_in(&leaf, bh->b_data);
+	*count = leaf.lf_entries;
 	return 0;
 }
 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-04-06  1:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-06  1:41 gfs1-utils: master - Fix block count in pass1b Bob Peterson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).