Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp495644imw; Wed, 13 Jul 2022 02:29:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vAHitVFueKPVhCQFO20f4y5qhVXOYU7/5wVPUvbi3AXGnewsQ4pDeV4f83mIc8k2nyDvGJ X-Received: by 2002:a17:90b:3d84:b0:1ef:9049:9f43 with SMTP id pq4-20020a17090b3d8400b001ef90499f43mr2876904pjb.45.1657704550927; Wed, 13 Jul 2022 02:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657704550; cv=none; d=google.com; s=arc-20160816; b=bThH9LoWcVbx1vxbRrw+H+AZIXLBPSSzO6nRzCQMU8EnbPYSSXPpZnKvIMhyKzrVDz 4QldfvWS4/lOn2j9vaPP7VHKnSV7OXflehwVNotro16fTPNuLXFA8yFyUtgFZdA9nrP+ fl1XcAEfKO7lz/Z3F750YLx8lW7bqZ6+w8qVmzdK/YRPGjzcHCtGEbZvpuKHs6tWTz/L ZEkwoqlIdCpG6KOknG5xDaSKqn/00bXlpTeN+jJTprtXn0Ixyx/PP1+MLehRv6/1nCS7 GzScLuoVMh4vXZnEwbvKNNEEbtoQ3KYr+PEMzhaCafiJne8qXxywSho8haFuYsg+gOTX 094g== 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=fXtL7019r/MmQ3PZUbGv/D8fmRXLBYgb2Zy7qWcMdL8=; b=APs6feZAmt3MRtd6JtUBfzcO9VXAqftzgQKtvtCbl5aXqlJ2WMFJaO+73a6ElSrKxZ Q4rcJ/oV3QtOJoO7TOQ5d4udG3eW5oHigInwhN4eg7PTZvjxb+QPXB4pnrkG3TNUuyiG 5HfbASWSX7IXK3qvuEfeUeaLWtKrmcdu7CCCQ8OEHpgyPivBj9dHyqqPha4ryu2BcXxy 9jPm1WjrCsmg0SbzdPYjMrqzNPdYc0z/9rTFvo5TIO9GYh3DM0hiFp+VtRaX3JbZibQ0 daWPINYGvDLWIROoSNOac+7LrWH1V+lwC5YCRVGEVeRmeeNb4K7X5tvESKkAiFgdwepr tgUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n12-20020a63f80c000000b0040c7d4d1b97si14708853pgh.299.2022.07.13.02.28.56; Wed, 13 Jul 2022 02:29:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235465AbiGMJQu (ORCPT + 99 others); Wed, 13 Jul 2022 05:16:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235645AbiGMJQn (ORCPT ); Wed, 13 Jul 2022 05:16:43 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88A19EA179; Wed, 13 Jul 2022 02:16:39 -0700 (PDT) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4LjX4B5gDQzhZ8C; Wed, 13 Jul 2022 17:14:02 +0800 (CST) Received: from kwepemm600010.china.huawei.com (7.193.23.86) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 13 Jul 2022 17:16:37 +0800 Received: from huawei.com (10.175.127.227) by kwepemm600010.china.huawei.com (7.193.23.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 13 Jul 2022 17:16:37 +0800 From: Sun Ke To: CC: , , Subject: [PATCH v3 1/2] ext4: resize fs after resize_inode without e2fsck Date: Wed, 13 Jul 2022 17:28:58 +0800 Message-ID: <20220713092859.3881376-2-sunke32@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220713092859.3881376-1-sunke32@huawei.com> References: <20220713092859.3881376-1-sunke32@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600010.china.huawei.com (7.193.23.86) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,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: X-Mailing-List: linux-ext4@vger.kernel.org Forget to run requested e2fsck after resize_inode, then resize fs, it will trigger off null pointer. Regression test for commit b55c3cd102a6 ext4: add reserved GDT blocks check. Signed-off-by: Sun Ke --- tests/ext4/057 | 44 ++++++++++++++++++++++++++++++++++++++++++++ tests/ext4/057.out | 3 +++ 2 files changed, 47 insertions(+) create mode 100755 tests/ext4/057 create mode 100644 tests/ext4/057.out diff --git a/tests/ext4/057 b/tests/ext4/057 new file mode 100755 index 00000000..44dae76c --- /dev/null +++ b/tests/ext4/057 @@ -0,0 +1,44 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2022 HUAWEI. All Rights Reserved. +# +# FS QA Test 057 +# +# Forget to run requested e2fsck after resize_inode, then resize fs, +# it will trigger off null pointer. +# +# Regression test for commit +# b55c3cd102a6 ext4: add reserved GDT blocks check +# +. ./common/preamble +_begin_fstest auto resize quick + +# real QA test starts here + +# Modify as appropriate. +_supported_fs ext4 +_fixed_by_kernel_commit b55c3cd102a6 \ + "ext4: add reserved GDT blocks check" + +_require_scratch +_require_command "$TUNE2FS_PROG" tune2fs +_require_command "$RESIZE2FS_PROG" resize2fs +_require_scratch_size $((1024 * 1024)) #kB + +# set fs size 512M +dev_size=$((512 * 1024 * 1024)) +_scratch_mkfs_sized $dev_size >> $seqres.full 2>&1 + +# forget to run requested e2fsck after resize_inode +$TUNE2FS_PROG -O ^resize_inode $SCRATCH_DEV | grep -w "e2fsck" + +_scratch_mount + +# resize fs will trigger NULL pointer in ext4_flex_group_add +$RESIZE2FS_PROG $SCRATCH_DEV 1G >> $seqres.full 2>&1 + +echo "Silence is golden" + +# success, all done +status=0 +exit diff --git a/tests/ext4/057.out b/tests/ext4/057.out new file mode 100644 index 00000000..4784ad7e --- /dev/null +++ b/tests/ext4/057.out @@ -0,0 +1,3 @@ +QA output created by 057 +Please run e2fsck -f on the filesystem. +Silence is golden -- 2.13.6