From patchwork Mon Oct 19 07:12:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vyacheslav Dubeyko X-Patchwork-Id: 36364 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org 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 4196DB7B86 for ; Mon, 19 Oct 2009 18:13:06 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754615AbZJSHMs (ORCPT ); Mon, 19 Oct 2009 03:12:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754354AbZJSHMs (ORCPT ); Mon, 19 Oct 2009 03:12:48 -0400 Received: from edge1.acronis.com ([91.195.23.132]:25718 "EHLO acronis.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753154AbZJSHMr convert rfc822-to-8bit (ORCPT ); Mon, 19 Oct 2009 03:12:47 -0400 From: Vyacheslav Dubeyko To: Andreas Dilger CC: "linux-ext4@vger.kernel.org" Date: Mon, 19 Oct 2009 11:12:41 +0400 Subject: RE: Patch on algorithm of place allocation for inode tables in mke2fs Thread-Topic: Patch on algorithm of place allocation for inode tables in mke2fs Thread-Index: AcpOi1S0j7fjA1sbQxq+y8uG6mEy7wB/4EIg Message-ID: <41BA663C8B2F72499F48B0EF991C188E04770A2EB3@RU-EXSTRCL1.ru.corp.acronis.com> References: <41BA663C8B2F72499F48B0EF991C188E04770A2C74@RU-EXSTRCL1.ru.corp.acronis.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-BitDefender-EV: 7.28425 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Hello all, I correct the patch: [root@localhost ext2fs]# git diff alloc_tables.c diff --git a/lib/ext2fs/alloc_tables.c b/lib/ext2fs/alloc_tables.c index 8547ad6..8ef4b05 100644 --- a/lib/ext2fs/alloc_tables.c +++ b/lib/ext2fs/alloc_tables.c @@ -84,7 +84,7 @@ errcode_t ext2fs_allocate_group_table(ext2_filsys fs, dgrp_t group, errcode_t retval; blk_t group_blk, start_blk, last_blk, new_blk, blk; dgrp_t last_grp = 0; - int j, rem_grps = 0, flexbg_size = 0; + int j, rem_grps = 0, flexbg_size = 0, inode_table_size = 0; group_blk = ext2fs_group_first_block(fs, group); last_blk = ext2fs_group_last_block(fs, group); @@ -181,10 +181,14 @@ errcode_t ext2fs_allocate_group_table(ext2_filsys fs, dgrp_t group, blk_t prev_block = 0; if (group && fs->group_desc[group-1].bg_inode_table) prev_block = fs->group_desc[group-1].bg_inode_table; + if ((group+1) == fs->group_desc_count && + (fs->group_desc_count % flexbg_size) == 1) + inode_table_size = fs->inode_blocks_per_group; + else + inode_table_size = fs->inode_blocks_per_group * rem_grps; group_blk = flexbg_offset(fs, group, prev_block, bmap, flexbg_size * 2, - fs->inode_blocks_per_group * - rem_grps, + inode_table_size, fs->inode_blocks_per_group); last_blk = ext2fs_group_last_block(fs, last_grp); }