Message ID | 20230629120044.1261968-5-shikemeng@huaweicloud.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9380263vqr; Wed, 28 Jun 2023 21:06:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5g4duVTL9tODQgP56vrr+StpG9TRDCK6IJ8s+WZ1FmdX18eC40AbUNYkXDYWPK2jtRouvC X-Received: by 2002:a17:90a:7527:b0:25d:eca9:1621 with SMTP id q36-20020a17090a752700b0025deca91621mr26286328pjk.6.1688011573941; Wed, 28 Jun 2023 21:06:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688011573; cv=none; d=google.com; s=arc-20160816; b=0Gpr4hwdSB2KlbDn2whw1tTReLtxwn0aum/YjdbXE/AxL24RRjgHocTIq1jcESYW1U vy9bJtthcYRZWhAhRMHV327/2Gs5kSCbw8F+DkAkTy1HV44ty9PBDACaTO4wGQ2Zsbn6 NUZoDPlPzTC08Ns6oDr/IByRDTdQJsmk+l6l09U73/CBfXzP57sv6xj09D/w0tBmvP6Z cfyAx0rihP9ah33+Io0QDFR26F0xOWlJv137ZDlnMnQ/eFcrB8LBdRQF6QnDj5PXHCFj Ek5GY6yQ6IrOijCvBbv8ICdj6SFYr3wB4ABhUcfAA7NiHoRHay0Adp4nJ6tq5NeFzFox E6Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=CRGTWl3y7QbAH/oRTnz3CcMJPCu+vzqbKfwKsoiJIq4=; fh=eu2llfKjKKC0QBUtW6YWJ13du6subP7SB8ZN6DjSWMA=; b=J6QHthwIyX+rvOF7qmkG1sxMAJ9+tUPD5fZkX29DoALRmrGlSoiwYsnyZOqeQYTmjS i9j1ufk81mfgdWvnf/quLTiCCu2Nxm+EumK2QeIhoLWKnpDQ/c6o4ZtJulNBLhnES7Sv oxO64jQVmK33QT0aZMzkg6yeujuUPAIGbCaa+Ik8FgiVIQ6tOB9zLsU0eYu4pFcTLiNZ 06fygZw44YD7DZ2El7Xa8LHced7Sz1zjPRU9NKnMQMJP/xT8mpVqKHa/38tfqeUXXFjg pqNvNNNjxjg1zLaLirffrZEUaW9SmDsCN+IUhE8pYbDjCxPbV6in7gLCZR8RIk51N4Mr sKZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j4-20020a170903028400b001ae014d8d03si10179933plr.432.2023.06.28.21.06.00; Wed, 28 Jun 2023 21:06:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232085AbjF2EA2 (ORCPT <rfc822;adanhawthorn@gmail.com> + 99 others); Thu, 29 Jun 2023 00:00:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231249AbjF2D7x (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 28 Jun 2023 23:59:53 -0400 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA46F2D50; Wed, 28 Jun 2023 20:59:51 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4Qs4Tc1XrTz4f3vqZ; Thu, 29 Jun 2023 11:59:48 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP2 (Coremail) with SMTP id Syh0CgC3quiwAZ1kw6DMMg--.26995S6; Thu, 29 Jun 2023 11:59:48 +0800 (CST) From: Kemeng Shi <shikemeng@huaweicloud.com> To: tytso@mit.edu, adilger.kernel@dilger.ca Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/13] ext4: remove gdb backup copy for meta bg in setup_new_flex_group_blocks Date: Thu, 29 Jun 2023 20:00:35 +0800 Message-Id: <20230629120044.1261968-5-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230629120044.1261968-1-shikemeng@huaweicloud.com> References: <20230629120044.1261968-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: Syh0CgC3quiwAZ1kw6DMMg--.26995S6 X-Coremail-Antispam: 1UD129KBjvJXoW7AF4xWrWxJFy5tFWDZrWDJwb_yoW8CFW3pr s3C3W5GFWUGrWjga18A392gF1kGw4xGr48trW5Ga1xGrW3X3WkWryqqF1IyFW5KFZIqrn2 q3Z8ZFy2yw17C3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUB2b4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Gr0_Xr1l8cAv FVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJw A2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE 3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr2 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6x kF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxU3XTQUUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, KHOP_HELO_FCRDNS,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770008423975064372?= X-GMAIL-MSGID: =?utf-8?q?1770008423975064372?= |
Series |
fixes and cleanups to ext4 resize
|
|
Commit Message
Kemeng Shi
June 29, 2023, noon UTC
Wrong check of gdb backup in meta bg as following: first_group is the first group of meta_bg which contains target group, so target group is always >= first_group. We check if target group has gdb backup by comparing first_group with [group + 1] and [group + EXT4_DESC_PER_BLOCK(sb) - 1]. As group >= first_group, then [group + N] is > first_group. So no copy of gdb backup in meta bg is done in setup_new_flex_group_blocks. No need to do gdb backup copy in meta bg from setup_new_flex_group_blocks as we always copy updated gdb block to backups at end of ext4_flex_group_add as following: ext4_flex_group_add /* no gdb backup copy for meta bg any more */ setup_new_flex_group_blocks /* update current group number */ ext4_update_super sbi->s_groups_count += flex_gd->count; /* * if group in meta bg contains backup is added, the primary gdb block * of the meta bg will be copy to backup in new added group here. */ for (; gdb_num <= gdb_num_end; gdb_num++) update_backups(...) In summary, we can remove wrong gdb backup copy code in setup_new_flex_group_blocks. Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> --- fs/ext4/resize.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index 0b3d8c808de1..0e83b3f91545 100644 --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c @@ -560,13 +560,8 @@ static int setup_new_flex_group_blocks(struct super_block *sb, if (meta_bg == 0 && !ext4_bg_has_super(sb, group)) goto handle_itb; - if (meta_bg == 1) { - ext4_group_t first_group; - first_group = ext4_meta_bg_first_group(sb, group); - if (first_group != group + 1 && - first_group != group + EXT4_DESC_PER_BLOCK(sb) - 1) - goto handle_itb; - } + if (meta_bg == 1) + goto handle_itb; block = start + ext4_bg_has_super(sb, group); /* Copy all of the GDT blocks into the backup in this group */