From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8703 invoked by alias); 6 Apr 2009 01:41:23 -0000 Received: (qmail 8696 invoked by alias); 6 Apr 2009 01:41:22 -0000 X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_41,SPF_HELO_PASS X-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_41,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion.fedora.phx.redhat.com Subject: gfs1-utils: master - Fix block count in pass1b. To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: gfs1-utils.git X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 3481e376f15903e00c9f565df46d7ad6849ff940 X-Git-Newrev: e45ae8a00674c0d37e21a0094e77562e223aa7f6 From: Bob Peterson Message-Id: <20090406014054.AD44B120315@lists.fedorahosted.org> Date: Mon, 06 Apr 2009 01:41:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00025.txt.bz2 Gitweb: http://git.fedorahosted.org/git/gfs1-utils.git?p=gfs1-utils.git;a=commitdiff;h=e45ae8a00674c0d37e21a0094e77562e223aa7f6 Commit: e45ae8a00674c0d37e21a0094e77562e223aa7f6 Parent: 3481e376f15903e00c9f565df46d7ad6849ff940 Author: Bob Peterson AuthorDate: Sun Apr 5 20:38:57 2009 -0500 Committer: Bob Peterson 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; }