Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp658155imw; Fri, 8 Jul 2022 09:22:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1shDXKq7WoWKQZGOQW12Pdk/QhDCREC+k9zPUtTJKfW9tbcLaLsqxfSSjareMuJLv3YEN4U X-Received: by 2002:a05:6a00:14c7:b0:525:89c1:35fb with SMTP id w7-20020a056a0014c700b0052589c135fbmr4679967pfu.36.1657297345724; Fri, 08 Jul 2022 09:22:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657297345; cv=none; d=google.com; s=arc-20160816; b=aKyTQGtgkclZIfcqDMWemP3KXClRnphTyNxJ5NSzFmzgCSPxU/oh9yupyjQp7wApFH 4gEACryAfjw+bgBzxZ+OgRIyW0rlYXsTqbZAstSzV7BtNKm1W+DvLCLNe8sIfVCq4Lzr aw2Uv9u7vv7oyTfUst03MF+KEANDS/iFLtmDzj+kuV7OGzrrY+0YxcXHr0Ss6uQyspDO yHkZPCGF9TDLmLDytrhM8zkJLhKhz3tdtw43OPV5NqmhoVNr9quX1QU6QrHu3mahp+vS hQ1AZvTc4nZh3tUaPXwuDlVOoxKKDpzv4Vey8nSZuPRkPfWa2V2ANDgYU4X+bdTMAuk+ joVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ufCmf3WEdeWlKZXCNOYen3ciETG60E/6u4zX3xCcdhI=; b=oLrPw7HXESZHCwKAEbzpjcQRAb44J/UklCBCgJoW3ZimIdO6fbfXgEK++fuI6c87wJ 4zJTgfFkpsT/2wWA6qmD8nzhgerb1rBVPKdZaV347RuxBKA+tf6NBGobLsDQP7WGAona wjFhJKAzL2HyMvFZRTFpezCEmg4PGbQPKRKPyl31G77Q0MQGZrr0Wb6PLCK82Y7vIA9c 0p64jsGJSYmwPIKChHEtq75eENSyhnSzcwTipuuxqjQK7cNtwLwNH1QS9kBEDc5re+vg zMU3Ccxs/epYO7+JxO0glZ9BlaMXYc4XfD/W5aQWtVPnvJDYl81uX2cda5Sr/Rul1u+Y +omQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=h9vXjfIV; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gp1-20020a17090adf0100b001df4ea7a026si2810204pjb.34.2022.07.08.09.22.04; Fri, 08 Jul 2022 09:22:25 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=h9vXjfIV; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238910AbiGHQQd (ORCPT + 99 others); Fri, 8 Jul 2022 12:16:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238902AbiGHQQd (ORCPT ); Fri, 8 Jul 2022 12:16:33 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1751076EB4; Fri, 8 Jul 2022 09:16:32 -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 BE655B80189; Fri, 8 Jul 2022 16:16:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81BA8C341C0; Fri, 8 Jul 2022 16:16:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657296989; bh=YlKqOue3jMK+6GSQ63KXsfwr9r5EJDm+PTdC8Y8HnR0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=h9vXjfIVWlYf3U1lgqd7oSDJUKIgDfpSOTVcLOvoa9NqDtRZGo+gnORd04jn7SwRe zkMjROuQo2LV7wsaiTCvtEq21UzWCCQeUTfmDNUAb2bkRUujepUzjupHV6Q5DuGdQI h6BoMNwe2k8xzYO5VaysU/jENYv8/fVSFnhcNuHUD03OXj79TtEJolOIqLwGAjZyQq f1uIgAkovhOCE832OPSBITnzxlozTN8mmR7/QdY++FuZogRNKGGs1C2XlhzeoUgiZQ r2iF6gnUiD+0q0lcFSEa3B6oPrYant1c97gLzvEfU7wKP9A19C6krc1O28jdokpCLg T5dA55cq2xQ6g== Date: Sat, 9 Jul 2022 00:16:24 +0800 From: Zorro Lang To: Sun Ke Cc: fstests@vger.kernel.org, linux-ext4@vger.kernel.org Subject: Re: [PATCH v2 1/2] ext4: resize fs after resize_inode without e2fsck Message-ID: <20220708161624.etkxdewnje4nhmhl@zlang-mailbox> References: <20220708112155.2639551-1-sunke32@huawei.com> <20220708112155.2639551-2-sunke32@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220708112155.2639551-2-sunke32@huawei.com> X-Spam-Status: No, score=-7.8 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,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 On Fri, Jul 08, 2022 at 07:21:54PM +0800, Sun Ke wrote: > 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 | 2 ++ > 2 files changed, 46 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..125f841a > --- /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 >$seqres.full 2>&1 Please use appending write ">>$seqres.full", to avoid seqres.full be overwritten. I think we don't need to filter out the error output, we don't expect there's an error, so if it fails, how about output errors to break golden image (remind the testers). > + > +_scratch_mount > + > +# resize fs will trigger NULL pointer in ext4_flex_group_add > +$RESIZE2FS_PROG $SCRATCH_DEV 1G >$seqres.full 2>&1 Appending write too... I'm not sure what's the necessary condition to reproduce the bug. Do you need to resize fs will trigger the bug, but after: # tune2fs -O ^resize_inode /dev/sda3 Then resize2fs always get: # resize2fs /dev/sda3 3g resize2fs 1.45.6 (20-Mar-2020) Please run 'e2fsck -f /dev/sda3' first. Looks like the resizing isn't run actually, is it what you really want? I've tried to review this patch from fstests side, better to get some review points from ext4 devel, to help to make sure that. Thanks, Zorro > + > +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..185023c7 > --- /dev/null > +++ b/tests/ext4/057.out > @@ -0,0 +1,2 @@ > +QA output created by 057 > +Silence is golden > -- > 2.13.6 >