From patchwork Sun Jan 29 16:01:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yongqiang Yang X-Patchwork-Id: 148248 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.180.67]) by ozlabs.org (Postfix) with ESMTP id 95D67B6EF4 for ; Fri, 23 Mar 2012 00:41:31 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756570Ab2CVNla (ORCPT ); Thu, 22 Mar 2012 09:41:30 -0400 Received: from mail-yw0-f46.google.com ([209.85.213.46]:53480 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756382Ab2CVNla (ORCPT ); Thu, 22 Mar 2012 09:41:30 -0400 Received: by yhmm54 with SMTP id m54so1716019yhm.19 for ; Thu, 22 Mar 2012 06:41:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=H0GozRfnDbQZtX1xaRKDDt84K/ngS4kwLeYMen3dqxw=; b=jQm0yyEayMuvINy3ObfJpt808hN1sC7zDCKJZGdfIeKuvQUqEWD4YC1s6m5H0h9DbF tnFW64W10luC3WHTVKSf5MDXxtdWBCi5RcO4vC9RrG1yqmOwMjXJUCHp80MmaUITZaFq a9fQkAtqMfLWq/OpNGTb43ZFmNwAu9m5lHV6NVHf7Ctr3tNmhWEvsIlN82c8Ftr0plbB AqWgaAIr9hW5xdW9yOm6zyGwPtvnPIU32ISBIVINxwTLTFVJ0+FprYDmaSVfiz00AgG9 dU47dMZ2ofIIYcOVa1ymdVODf1OdPiAMUdivKiWMPw9FzJMyZwwghVJXlvMlYu9jEd7f Q3UA== Received: by 10.50.40.166 with SMTP id y6mr1613567igk.69.1332423689521; Thu, 22 Mar 2012 06:41:29 -0700 (PDT) Received: from localhost.localdomain ([159.226.43.42]) by mx.google.com with ESMTPS id ko6sm1412236igc.2.2012.03.22.06.41.27 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Mar 2012 06:41:28 -0700 (PDT) From: Yongqiang Yang To: linux-ext4@vger.kernel.org Cc: adilger@gmail.com, Yongqiang Yang Subject: [PATCH 1/4] ext4: do not copy gdt blocks for groups which do not have super when resizing Date: Mon, 30 Jan 2012 00:01:03 +0800 Message-Id: <1327852866-4448-2-git-send-email-xiaoqiangnk@gmail.com> X-Mailer: git-send-email 1.7.5.1 In-Reply-To: <1327852866-4448-1-git-send-email-xiaoqiangnk@gmail.com> References: <1327852866-4448-1-git-send-email-xiaoqiangnk@gmail.com> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org There is no need to copy gdt blocks for groups which do not have super in resizing code, so this patch let resize code skip the groups. Signed-off-by: Yongqiang Yang --- fs/ext4/resize.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index 59fa0be..9a6fb74 100644 --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c @@ -449,6 +449,9 @@ static int setup_new_flex_group_blocks(struct super_block *sb, gdblocks = ext4_bg_num_gdb(sb, group); start = ext4_group_first_block_no(sb, group); + if (!ext4_bg_has_super(sb, group)) + goto handle_itb; + /* Copy all of the GDT blocks into the backup in this group */ for (j = 0, block = start + 1; j < gdblocks; j++, block++) { struct buffer_head *gdb; @@ -491,6 +494,7 @@ static int setup_new_flex_group_blocks(struct super_block *sb, goto out; } +handle_itb: /* Initialize group tables of the grop @group */ if (!(bg_flags[i] & EXT4_BG_INODE_ZEROED)) goto handle_bb;