From patchwork Thu Sep 3 21:02:04 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 32915 Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id BA94BB708B for ; Fri, 4 Sep 2009 07:02:42 +1000 (EST) Received: by ozlabs.org (Postfix) id AAC36DDD0C; Fri, 4 Sep 2009 07:02:42 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 3D3D3DDD04 for ; Fri, 4 Sep 2009 07:02:42 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932303AbZICVCF (ORCPT ); Thu, 3 Sep 2009 17:02:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932302AbZICVCF (ORCPT ); Thu, 3 Sep 2009 17:02:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19090 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932301AbZICVCE (ORCPT ); Thu, 3 Sep 2009 17:02:04 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n83L26mR014308 for ; Thu, 3 Sep 2009 17:02:06 -0400 Received: from neon.msp.redhat.com (neon.msp.redhat.com [10.15.80.10]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n83L24At001901 for ; Thu, 3 Sep 2009 17:02:05 -0400 Message-ID: <4AA02ECC.4010101@redhat.com> Date: Thu, 03 Sep 2009 16:02:04 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: ext4 development Subject: [PATCH] libext2fs: last of the incorrect direct group_desc accesses X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org This should be, I hope, the last of the fixes for accessing the group descriptors directly in libext2fs, at least. Soon we should make it opaque to avoid this mess. Signed-off-by: Eric Sandeen --- -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: e2fsprogs/lib/ext2fs/openfs.c =================================================================== --- e2fsprogs.orig/lib/ext2fs/openfs.c +++ e2fsprogs/lib/ext2fs/openfs.c @@ -355,7 +355,7 @@ errcode_t ext2fs_open2(const char *name, for (group = 0; group < fs->group_desc_count; group++) { ext2fs_bg_flag_clear(fs, group, EXT2_BG_BLOCK_UNINIT); ext2fs_bg_flag_clear(fs, group, EXT2_BG_INODE_UNINIT); - fs->group_desc[group].bg_itable_unused = 0; + ext2fs_bg_itable_unused_set(fs, group, 0); } ext2fs_mark_super_dirty(fs); } Index: e2fsprogs/e2fsck/pass2.c =================================================================== --- e2fsprogs.orig/e2fsck/pass2.c +++ e2fsprogs/e2fsck/pass2.c @@ -1003,7 +1003,7 @@ out_htree: } else if (dirent->inode >= first_unused_inode) { pctx.num = dirent->inode; if (fix_problem(ctx, PR_2_INOREF_IN_UNUSED, &cd->pctx)){ - fs->group_desc[group].bg_itable_unused = 0; + ext2fs_bg_itable_unused_set(fs, group, 0); ext2fs_mark_super_dirty(fs); ctx->flags |= E2F_FLAG_RESTART_LATER; } else {