Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE12CC433F5 for ; Mon, 11 Apr 2022 22:08:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236068AbiDKWKx (ORCPT ); Mon, 11 Apr 2022 18:10:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235263AbiDKWKw (ORCPT ); Mon, 11 Apr 2022 18:10:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A304205DA for ; Mon, 11 Apr 2022 15:08:37 -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 28E07B8170E for ; Mon, 11 Apr 2022 22:08:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C05F8C385A3; Mon, 11 Apr 2022 22:08:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649714914; bh=frSVGIH9um1kcItHauKgRFk79kyxPV1JEcEvyM9mqYE=; h=Date:From:To:Subject:References:In-Reply-To:From; b=IqdGiDE1ee/biNLCOWhSj7MQfZXQQ4aRZImrdLxoABuV7pnykpE12oulAuuAv3EnC yrPkRS1yrR5KLGX6b6Mgjxcg+2s9UsIK7fbRhbhR8x62hY5XOk1D/imsPmb21TElgq ngOvEn23GO4r99Vorng8yxwmFDbqo2BvO13bGob/SV1314XN+2IJb3B0pVSnNsPvEO b9WZ/el1lgcABFEqkf9gVKzK5cKZQOopvgR5PyigUm+YdWDaKvRHPcWjs+eHKz+hND YMc1UAT4AaqKqeqUYSnzCS6CN+1MB2AcUh7cWu/FB/MSEph9QmkpyloEVupuJes9ND 1Lv75A+D0hfvw== Date: Mon, 11 Apr 2022 15:08:34 -0700 From: "Darrick J. Wong" To: Dave Chinner , fstests@vger.kernel.org Subject: Re: [PATCH v2] xfs: test xfsdump when an inode < root inode is present Message-ID: <20220411220834.GB16824@magnolia> References: <20220408170847.1088522-1-zlang@redhat.com> <20220409040056.GA14099@magnolia> <20220410121103.wk2hgixq57dogzah@zlang-mailbox> <20220411053135.GH1609613@dread.disaster.area> <20220411083433.omc3yvn75k5ap6zk@zlang-mailbox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220411083433.omc3yvn75k5ap6zk@zlang-mailbox> Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org On Mon, Apr 11, 2022 at 04:34:33PM +0800, Zorro Lang wrote: > On Mon, Apr 11, 2022 at 03:31:35PM +1000, Dave Chinner wrote: > > On Sun, Apr 10, 2022 at 08:11:03PM +0800, Zorro Lang wrote: > > > On Fri, Apr 08, 2022 at 09:00:56PM -0700, Darrick J. Wong wrote: > > > > On Sat, Apr 09, 2022 at 01:08:47AM +0800, Zorro Lang wrote: > > > > > From: Eric Sandeen > > > > > > > > > > This tests a longstanding bug where xfsdumps are not properly > > > > > created when an inode is present on the filesytsem which has > > > > > a lower number than the root inode. > > > > > > > > > > Signed-off-by: Eric Sandeen > > > > > Signed-off-by: Zorro Lang > > > > > --- > > > > > > > > > > Friendly ping for reviewing. > > > > > > > > > > Thanks, > > > > > Zorro > > > > > > > > > > common/dump | 1 + > > > > > tests/xfs/543 | 63 +++++++++++++++++++++++++++++++++++++++++++++++ > > > > > tests/xfs/543.out | 47 +++++++++++++++++++++++++++++++++++ > > > > > 3 files changed, 111 insertions(+) > > > > > create mode 100755 tests/xfs/543 > > > > > create mode 100644 tests/xfs/543.out > > > > > > > > > > diff --git a/common/dump b/common/dump > > > > > index ea16d442..ab48cd13 100644 > > > > > --- a/common/dump > > > > > +++ b/common/dump > > > > > @@ -219,6 +219,7 @@ _require_tape() > > > > > > > > > > _wipe_fs() > > > > > { > > > > > + [[ "$WIPE_FS" = "no" ]] && return > > > > > > > > Is WIPE_FS intended as a general means to prevent wipefs -a between > > > > tests? If so, it ought to be in the README. > > > > > > Actually I don't know how to if I should say WIPE_FS means to prevent > > > wipefs -a between tests. Due to: > > > > > > 1) We have a _wipe_fs() in common/dump[1], it's very old, and it only > > > try to make a new xfs, although it calls wipe "fs"... And it's only used > > > for tests/xfs/* cases to call _create_dumpdir_*() function. > > > > > > 2) Then we have _try_wipe_scratch_devs() in common/rc [2], which calls > > > _try_wipe_scratch_xfs() in common/xfs [3] (which is newer), it's only > > > used in ./check script now. > > > > > > So I'm wondering if we'd better to change the _wipe_fs() to: > > > _wipe_dump() > > > { > > > [[ "$WIPE_DUMP" = "no" ]] && return > > > _require_scratch > > > > > > _try_wipe_scratch_devs >>$seqres.full > > > _scratch_mount >>$seqres.full > > > } > > > > > > What do you think? > > > > common/dump::_wipe_fs() is effectively just _scratch_mkfs() followed > > by mounting it. It does not need to exist at all. Aha! > Oh! I was really confused why dumpdir need to wipefs at first, so that's > the reason. I just checked all cases which call _create_dumpdir_*, and > yes, they just hope to omit below common steps by running _create_dumpdir_*: > _require_scratch > _scratch_mkfs > _scratch_mount > > I'd like to remove the common/dump::_wipe_fs(), and help all related cases > call _require_scratch && _scratch_mkfs && _scratch_mount by themselves. Due > to it's match the current xfstests case format. > > Is that good to you? Anymore suggestions or notice ? Sounds good to /me. --D > Thanks, > Zorro > > > > > The test(s) need to have run _require_scratch() in it's setup, it > > shouldn't be hidden deep inside random functions that fill the > > scratch device. > > > > They should also run scratch_mkfs/mount themselves to prep the > > scratch device, and then _wipe_fs() can go away entirely. > > > > And the new test simply calls the function to populate the scratch > > device at the place where you want to preserve the previous contents > > of the scratch device without first running scratch_mkfs.... > > > > Cheers, > > > > Dave. > > -- > > Dave Chinner > > david@fromorbit.com > > >