From patchwork Sat Oct 22 07:29:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7858 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1161046wrr; Sat, 22 Oct 2022 04:29:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6J9NZKNMZTv6PgTa4myIdHv1hvVE4tNTV5JsvqoSmO0r6TDvIZPT1Xku+VEr2JG2T2Vl9b X-Received: by 2002:a63:1a07:0:b0:46b:2825:f9cf with SMTP id a7-20020a631a07000000b0046b2825f9cfmr20911865pga.370.1666438166958; Sat, 22 Oct 2022 04:29:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666438166; cv=none; d=google.com; s=arc-20160816; b=F48Do68LUpYxVhGQn57iq2m4fx2vSnT5TYc7IU+yC9pNYGa+EZ5IXEBjAT5woAUGHU hkqLOTn5o3XQT2pwqRY6JJggpk+sFlwmMcD2sXfDaG+OX79spQcy9dL4PjwuWOrQjhMv lfFqNXFGaDqdxvJmFIooDDvahokK9Pc7IP+9UHJfHNBIt6p4Gt8Djzu66hWJ7+2SjFk+ 9IvBRpghLxoFwO9rSlKqf2mtDOugdw8AceJ3oXH2tl8CYLcbV5mQSZuA9TA3kQihTSSv 3BQncYtxRVytFBLHK6TCsE+JZRlxxghqO6ffW335Zf4W4HMRHrMDdXjIybPRaUlv/pGx /gYQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wX2bvX8XiJWQKJSflfkfFr19pfF+6o6PYMv0ztv4PYE=; b=nUiLdzGcy2rs12Gei5ZnjzuA1BUsgOQCqsgSKg795gJSd1cBZ4WR8B2j3cy1MAgoBH O4mO9sLg+JGH1+fRZ9//JjWcp/E3V4013WNLfgfWk3KY9vpC4hsip3LDaef/DqY8qeGy rbjGyllixBkGz7r/jhTJGH1UeSIucbu4KmcskgHTx6lVjBjwnJMrWuEXkOUCzBhYnHrV PBmYdObYGHQ1OK0Txge3gef68PafIJ1uN+vR5P3a6PgOOx6pbijjjGOzw8gRf9Pox34Z 0jVnmpHAp/W3RqHUbyeWUDzdSjAecuqtpXj0qdkKt791DCvWMpoAz3fW1tAMEd5tj2x7 Wywg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dcNr+nr8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b6-20020a056a0002c600b0056615a18b20si25699730pft.250.2022.10.22.04.29.14; Sat, 22 Oct 2022 04:29:26 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dcNr+nr8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230445AbiJVLTb (ORCPT + 99 others); Sat, 22 Oct 2022 07:19:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230255AbiJVLTD (ORCPT ); Sat, 22 Oct 2022 07:19:03 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CEFECA; Sat, 22 Oct 2022 03:46:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D7979B82DFE; Sat, 22 Oct 2022 08:08:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 308BEC433C1; Sat, 22 Oct 2022 08:08:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666426090; bh=N8mowMvAqrmgwRPvaI4cyXf2wucadEu5438JlOL0RYk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dcNr+nr8JTmyT1Bs3f5WUcJCcZwR4qCMYYD22YD4oNydxaNXlDRbV3QDojpQ9Ag6i rww7djtT2/MfQFd3Uz7ndoa2NrGVWnqLpxqrV5DDgXQKmKQv9R/MAsZB/MwkLuC9iQ EFjR2psKk0EAMEv7F8NCQSZH5AHoH35wXl6xF9BI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jerry Lee , Theodore Tso Subject: [PATCH 5.19 714/717] ext4: continue to expand file system when the target size doesnt reach Date: Sat, 22 Oct 2022 09:29:53 +0200 Message-Id: <20221022072530.047462081@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747387067227785886?= X-GMAIL-MSGID: =?utf-8?q?1747387067227785886?= From: Jerry Lee 李修賢 commit df3cb754d13d2cd5490db9b8d536311f8413a92e upstream. When expanding a file system from (16TiB-2MiB) to 18TiB, the operation exits early which leads to result inconsistency between resize2fs and Ext4 kernel driver. === before === ○ → resize2fs /dev/mapper/thin resize2fs 1.45.5 (07-Jan-2020) Filesystem at /dev/mapper/thin is mounted on /mnt/test; on-line resizing required old_desc_blocks = 2048, new_desc_blocks = 2304 The filesystem on /dev/mapper/thin is now 4831837696 (4k) blocks long. [ 865.186308] EXT4-fs (dm-5): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none. [ 912.091502] dm-4: detected capacity change from 34359738368 to 38654705664 [ 970.030550] dm-5: detected capacity change from 34359734272 to 38654701568 [ 1000.012751] EXT4-fs (dm-5): resizing filesystem from 4294966784 to 4831837696 blocks [ 1000.012878] EXT4-fs (dm-5): resized filesystem to 4294967296 === after === [ 129.104898] EXT4-fs (dm-5): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none. [ 143.773630] dm-4: detected capacity change from 34359738368 to 38654705664 [ 198.203246] dm-5: detected capacity change from 34359734272 to 38654701568 [ 207.918603] EXT4-fs (dm-5): resizing filesystem from 4294966784 to 4831837696 blocks [ 207.918754] EXT4-fs (dm-5): resizing filesystem from 4294967296 to 4831837696 blocks [ 207.918758] EXT4-fs (dm-5): Converting file system to meta_bg [ 207.918790] EXT4-fs (dm-5): resizing filesystem from 4294967296 to 4831837696 blocks [ 221.454050] EXT4-fs (dm-5): resized to 4658298880 blocks [ 227.634613] EXT4-fs (dm-5): resized filesystem to 4831837696 Signed-off-by: Jerry Lee Link: https://lore.kernel.org/r/PU1PR04MB22635E739BD21150DC182AC6A18C9@PU1PR04MB2263.apcprd04.prod.outlook.com Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/resize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c @@ -2100,7 +2100,7 @@ retry: goto out; } - if (ext4_blocks_count(es) == n_blocks_count) + if (ext4_blocks_count(es) == n_blocks_count && n_blocks_count_retry == 0) goto out; err = ext4_alloc_flex_bg_array(sb, n_group + 1);