From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17668 invoked by alias); 31 Aug 2009 17:53:52 -0000 Received: (qmail 17660 invoked by alias); 31 Aug 2009 17:53:52 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_66,SPF_HELO_PASS X-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_66,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion2.fedora.phx.redhat.com Subject: cluster: STABLE2 - gfs2_edit: Fix rindex read function for gfs1 file systems To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/STABLE2 X-Git-Reftype: branch X-Git-Oldrev: 17f2b5baf3b61c69ed2328fad89bd8cbc9bbebde X-Git-Newrev: 2f07da23c9e8d93647ba4525614f2ff4e8d32e6a From: Bob Peterson Message-Id: <20090831175325.F181C1201D4@lists.fedorahosted.org> Date: Mon, 31 Aug 2009 17:53:00 -0000 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 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-q3/txt/msg00272.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=2f07da23c9e8d93647ba4525614f2ff4e8d32e6a Commit: 2f07da23c9e8d93647ba4525614f2ff4e8d32e6a Parent: 17f2b5baf3b61c69ed2328fad89bd8cbc9bbebde Author: Bob Peterson AuthorDate: Mon Aug 31 11:36:41 2009 -0500 Committer: Bob Peterson CommitterDate: Mon Aug 31 12:55:01 2009 -0500 gfs2_edit: Fix rindex read function for gfs1 file systems The gfs2_edit program was written before libgfs2 had support for GFS1 data structures, therefore, the reading of rindex was horribly kludged. This switches to the new standard way of reading rindex for GFS1. rhbz#503529 --- gfs2/edit/hexedit.c | 25 +++++++------------------ 1 files changed, 7 insertions(+), 18 deletions(-) diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c index d547d85..0e76c83 100644 --- a/gfs2/edit/hexedit.c +++ b/gfs2/edit/hexedit.c @@ -957,27 +957,16 @@ int parse_rindex(struct gfs2_inode *di, int print_rindex) eol(0); lines_per_row[dmode] = 6; memset(highlighted_addr, 0, sizeof(highlighted_addr)); - if (gfs1) { - /* gfs1 rindex files have the meta_header which is not - accounted for in gfs2's dinode size. Therefore, adjust. */ - di->i_di.di_size += ((di->i_di.di_size / sbd.bsize) + 1) * - sizeof(struct gfs2_meta_header); - } - for (print_entry_ndx=0; ; print_entry_ndx++) { - uint64_t gfs1_adj = 0; - uint64_t offset = print_entry_ndx * risize(); - if (gfs1) { - uint64_t sd_jbsize = - (sbd.bsize - sizeof(struct gfs2_meta_header)); + for (print_entry_ndx=0; ; print_entry_ndx++) { + uint64_t offset; - gfs1_adj = (offset / sd_jbsize) * - sizeof(struct gfs2_meta_header); - gfs1_adj += sizeof(struct gfs2_meta_header); - } + offset = print_entry_ndx * risize(); - error = gfs2_readi(di, (void *)&buf, offset + gfs1_adj, - risize()); + if (gfs1) + error = gfs1_readi(di, (void *)&buf, offset, risize()); + else + error = gfs2_readi(di, (void *)&buf, offset, risize()); if (!error) /* end of file */ break; gfs2_rindex_in(&ri, buf);