From mboxrd@z Thu Jan 1 00:00:00 1970 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 E0689C61DA4 for ; Tue, 14 Feb 2023 08:01:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229853AbjBNIBg (ORCPT ); Tue, 14 Feb 2023 03:01:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230340AbjBNIBV (ORCPT ); Tue, 14 Feb 2023 03:01:21 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A302A222D8 for ; Tue, 14 Feb 2023 00:00:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676361614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BgMue5w2JVSiPn5I5OoXQEIIrJbaZshclf45BstvmDM=; b=HwbB0ps94XD0Xi9J9PoFXy9ogNjHIlS2WKeCoUqZZ7ANfGuTVdBCFrZG/TVptqGjZJRwOQ HIAOvyYO5z+Gb1iLXmsIjQogOB85rYXtwZeFArzmgS+jBFerOsvzCLXxBf8bmH7sUy87OH NfAH6fmBXma4Oti1YvyI3El8BRGgx74= Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-642-3LrGxRMhOyam-Tn5gYJSTA-1; Tue, 14 Feb 2023 03:00:13 -0500 X-MC-Unique: 3LrGxRMhOyam-Tn5gYJSTA-1 Received: by mail-pl1-f199.google.com with SMTP id u15-20020a170902a60f00b001992a366c3bso8745352plq.12 for ; Tue, 14 Feb 2023 00:00:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BgMue5w2JVSiPn5I5OoXQEIIrJbaZshclf45BstvmDM=; b=T5C0WN0ggHDHBIjsJ7ByXRaOM/0bd65rN/063MwIamOZkB/Ak60qgrzp/gXvxZClmP r34w8dQ3ZVV9Zbv5Lc5McgW03NrsaOM1T7oJqLzzCePI/uAUUdSr22wW4ZjT3yki4QHm 9QgER/OafprWoifWR8PcGzUu6QTsKQv64TmsXVlxs4u+BFrE+q3bpu09E55wr2CrqSUy +UOfBoF7K+4QDFR0gMPtyWFfv00gyuK42lDvEyONbXJqkIzmR/KUrWdrQifmxEwTnr8F CB3t3W6ZwT1h3S/UV+3HLlqA3csqtsF+nNtRFDbZb8ZWs6aiWlt/TaWYmVZ9jnrmyeVa K4tQ== X-Gm-Message-State: AO0yUKX6s/jMjJA+gXJuKM0dCqR+y3wv9Zh7+M2udOeKAR2BvePyL/4j kYjDn6ZzvBj58NbysXKOJ955VYJ7ZlbM+cH7eqr7NdKwMLTeaFMfIzIIxNw/+aCqVfbK7Lo/VOl 7yHzQLkQlpaOkCPjcIQ== X-Received: by 2002:a17:90b:4d91:b0:233:f354:e7f6 with SMTP id oj17-20020a17090b4d9100b00233f354e7f6mr1338142pjb.46.1676361612238; Tue, 14 Feb 2023 00:00:12 -0800 (PST) X-Google-Smtp-Source: AK7set/OiLgAlO0CU4FnmTlAHb/aGKd7gOqEeQReYo8YxH7F4/Is3a0ZIJvZir+rw28SM9AuSCa+OA== X-Received: by 2002:a17:90b:4d91:b0:233:f354:e7f6 with SMTP id oj17-20020a17090b4d9100b00233f354e7f6mr1338119pjb.46.1676361611837; Tue, 14 Feb 2023 00:00:11 -0800 (PST) Received: from zlang-mailbox ([43.228.180.230]) by smtp.gmail.com with ESMTPSA id d3-20020a17090a3b0300b002340b73ded1sm2437899pjc.26.2023.02.14.00.00.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 00:00:11 -0800 (PST) Date: Tue, 14 Feb 2023 16:00:07 +0800 From: Zorro Lang To: "Darrick J. Wong" Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Subject: Re: [PATCH 1/1] fuzzy: use FORCE_REBUILD over injecting force_repair Message-ID: <20230214080007.i7m5hzlcmthd6ka3@zlang-mailbox> References: <167243874952.722591.1496636246267309523.stgit@magnolia> <167243874964.722591.9199494099572054329.stgit@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <167243874964.722591.9199494099572054329.stgit@magnolia> Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org On Fri, Dec 30, 2022 at 02:19:09PM -0800, Darrick J. Wong wrote: > From: Darrick J. Wong > > For stress testing online repair, try to use the FORCE_REBUILD ioctl > flag over the error injection knobs whenever possible because the knobs > are very noisy and are not always available. > > Signed-off-by: Darrick J. Wong > --- > common/fuzzy | 34 +++++++++++++++++++++++++++++++--- > 1 file changed, 31 insertions(+), 3 deletions(-) > > > diff --git a/common/fuzzy b/common/fuzzy > index f7f660bc31..14f7fdf03c 100644 > --- a/common/fuzzy > +++ b/common/fuzzy > @@ -398,6 +398,9 @@ __stress_one_scrub_loop() { > > local xfs_io_args=() > for arg in "$@"; do > + if [ -n "$SCRUBSTRESS_USE_FORCE_REBUILD" ]; then > + arg="$(echo "$arg" | sed -e 's/^repair/repair -R/g')" > + fi > if echo "$arg" | grep -q -w '%agno%'; then > # Substitute the AG number > for ((agno = 0; agno < agcount; agno++)); do > @@ -695,13 +698,21 @@ _require_xfs_stress_scrub() { > _notrun 'xfs scrub stress test requires common/filter' > } > > +# Make sure that we can force repairs either by error injection or passing > +# FORCE_REBUILD via ioctl. > +__require_xfs_stress_force_rebuild() { > + local output="$($XFS_IO_PROG -x -c 'repair -R probe' $SCRATCH_MNT 2>&1)" > + test -z "$output" && return > + _require_xfs_io_error_injection "force_repair" > +} > + > # Make sure we have everything we need to run stress and online repair > _require_xfs_stress_online_repair() { > _require_xfs_stress_scrub > _require_xfs_io_command "repair" > command -v _require_xfs_io_error_injection &>/dev/null || \ > _notrun 'xfs repair stress test requires common/inject' > - _require_xfs_io_error_injection "force_repair" > + __require_xfs_stress_force_rebuild > _require_freeze > } > > @@ -783,7 +794,11 @@ __stress_scrub_check_commands() { > esac > > for arg in "$@"; do > - local cooked_arg="$(echo "$arg" | sed -e "s/%agno%/0/g")" > + local cooked_arg="$arg" > + if [ -n "$SCRUBSTRESS_USE_FORCE_REBUILD" ]; then > + cooked_arg="$(echo "$cooked_arg" | sed -e 's/^repair/repair -R/g')" > + fi > + cooked_arg="$(echo "$cooked_arg" | sed -e "s/%agno%/0/g")" > testio=`$XFS_IO_PROG -x -c "$cooked_arg" "$cooked_tgt" 2>&1` > echo $testio | grep -q "Unknown type" && \ > _notrun "xfs_io scrub subcommand support is missing" > @@ -943,10 +958,23 @@ _scratch_xfs_stress_scrub() { > echo "Loop finished at $(date)" >> $seqres.full > } > > +# Decide if we're going to force repairs either by error injection or passing > +# FORCE_REBUILD via ioctl. > +__scratch_xfs_stress_setup_force_rebuild() { > + local output="$($XFS_IO_PROG -x -c 'repair -R probe' $SCRATCH_MNT 2>&1)" > + > + if [ -z "$output" ]; then > + export SCRUBSTRESS_USE_FORCE_REBUILD=1 Do you need to use this parameter ^^ in another child process? Is the "export" necessary? Thanks, Zorro > + return > + fi > + > + $XFS_IO_PROG -x -c 'inject force_repair' $SCRATCH_MNT > +} > + > # Start online repair, freeze, and fsstress in background looping processes, > # and wait for 30*TIME_FACTOR seconds to see if the filesystem goes down. > # Same requirements and arguments as _scratch_xfs_stress_scrub. > _scratch_xfs_stress_online_repair() { > - $XFS_IO_PROG -x -c 'inject force_repair' $SCRATCH_MNT > + __scratch_xfs_stress_setup_force_rebuild > XFS_SCRUB_FORCE_REPAIR=1 _scratch_xfs_stress_scrub "$@" > } >