From patchwork Sun Jun 19 13:46:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 12886670 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 E2F12CCA47A for ; Sun, 19 Jun 2022 13:47:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230228AbiFSNr0 (ORCPT ); Sun, 19 Jun 2022 09:47:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236224AbiFSNrJ (ORCPT ); Sun, 19 Jun 2022 09:47:09 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EB9E637B for ; Sun, 19 Jun 2022 06:47:08 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id g27so4681687wrb.10 for ; Sun, 19 Jun 2022 06:47:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lspYXotJXIgD9rJo2AqmUY24qO9c5voykkTiI+kyxYw=; b=K0tjo59tsCY6kphCsc4nBNJjkxGkqo15n6jtyI8Daniwku3hbZnwnz9OyCQv75+jsg 9KfBN9fYpNKEXqsRE6LZlpZWWxIZnW9vUlR5v/QeE95FS1WTQXS4RL1ELRdQjz0clijI TuxrjquDiv89PUw4HU+5wpIV1mJl/Aoo2esxAVx7iJPBiPoBO2fo+gj44g5nlM00UXsa uZu0m3wY4BN7AcjonGSC/ItbjL/RmZulPWUnNq85x42rlFJGhxARM5abuCJekvL3jYbH 3+J+1dft8KjYl8GUXMIbKf2h0u3LYk9nJ3IwG4hby2mr8/eJGDdcIaKQaUIurWFu8dz9 wTXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lspYXotJXIgD9rJo2AqmUY24qO9c5voykkTiI+kyxYw=; b=fR/QOjldu4dEusOJ7QtTHa5bCtZF+bAGGCsKpZvGukY7H7JdYQC8DWwz7lWvACQBVP 6tayInGwPutDbK9+LRfTV8bHj4gLWAdiJxK/7hvVcfFTBqWMz7x83Wgo4X2y1YUatwOS L1F207EBjrNriIUrMd/1+zGj1WuJYt/3iGDm0CvZ62Xup1OmpXGCK3bK4qQNRVkPoixd 7/j1Gvp3E3t7BCd8V//ATACmdpPnzT45Img689ZkZje90SM0LRMyED5QMaWPW/XQRLMd gw8gyB2cYbL+EgP3W9y9RbkYps7VPuumicnqYsIluKPz+BTc+bRrSCd8nsGjCEcGA1NK etSQ== X-Gm-Message-State: AJIora/rOrexkY8Y0pV0ixhWke8wDeme7/vaqk3WCs8o0/GIefuW7mLL ysZLYRqlc+CTwCF6P6BntWY= X-Google-Smtp-Source: AGRyM1tjuh5AuiBgFI1Ede0lFVxlF8XCcG9mBOo1Daqnfe/rUb5H+9K3LuOKROBjmG5DP42W3taRgg== X-Received: by 2002:a05:6000:3cd:b0:21b:8e8d:470f with SMTP id b13-20020a05600003cd00b0021b8e8d470fmr1124883wrg.387.1655646426774; Sun, 19 Jun 2022 06:47:06 -0700 (PDT) Received: from localhost.localdomain ([77.137.66.49]) by smtp.gmail.com with ESMTPSA id q18-20020adfcd92000000b00219e77e489fsm5240927wrj.17.2022.06.19.06.47.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jun 2022 06:47:06 -0700 (PDT) From: Amir Goldstein To: Zorro Lang Cc: "Darrick J . Wong" , Dave Chinner , fstests@vger.kernel.org Subject: [PATCH 1/4] fstests: add missing _require_freeze() to tests Date: Sun, 19 Jun 2022 16:46:54 +0300 Message-Id: <20220619134657.1846292-2-amir73il@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220619134657.1846292-1-amir73il@gmail.com> References: <20220619134657.1846292-1-amir73il@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org And add a few tests that use freeze to the freeze group Signed-off-by: Amir Goldstein --- tests/xfs/119 | 1 + tests/xfs/318 | 3 ++- tests/xfs/325 | 3 ++- tests/xfs/422 | 3 ++- tests/xfs/438 | 2 +- tests/xfs/517 | 1 + 6 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/xfs/119 b/tests/xfs/119 index a1180371..b6f96601 100755 --- a/tests/xfs/119 +++ b/tests/xfs/119 @@ -20,6 +20,7 @@ _begin_fstest log v2log auto freeze _supported_fs xfs _require_scratch +_require_freeze # this may hang sync diff --git a/tests/xfs/318 b/tests/xfs/318 index 38c7aa60..be93f9ab 100755 --- a/tests/xfs/318 +++ b/tests/xfs/318 @@ -7,7 +7,7 @@ # Simulate free extent errors with a file write and a file remove. # . ./common/preamble -_begin_fstest auto quick rw +_begin_fstest auto quick rw freeze # Override the default cleanup function. _cleanup() @@ -26,6 +26,7 @@ _supported_fs xfs _require_scratch _require_error_injection _require_xfs_io_error_injection "rmap_finish_one" +_require_freeze blksz=65536 blks=64 diff --git a/tests/xfs/325 b/tests/xfs/325 index 5b26b2b3..c6861fbc 100755 --- a/tests/xfs/325 +++ b/tests/xfs/325 @@ -8,7 +8,7 @@ # Inject an error during extent freeing to test log recovery. # . ./common/preamble -_begin_fstest auto quick clone +_begin_fstest auto quick clone freeze # Override the default cleanup function. _cleanup() @@ -29,6 +29,7 @@ _require_cp_reflink _require_scratch_reflink _require_error_injection _require_xfs_io_error_injection "free_extent" +_require_freeze blksz=65536 blks=30 diff --git a/tests/xfs/422 b/tests/xfs/422 index 175253aa..a83a66df 100755 --- a/tests/xfs/422 +++ b/tests/xfs/422 @@ -9,7 +9,7 @@ # activity, so we can't have userspace wandering in and thawing it. # . ./common/preamble -_begin_fstest dangerous_scrub dangerous_online_repair +_begin_fstest dangerous_scrub dangerous_online_repair freeze _register_cleanup "_cleanup" BUS @@ -24,6 +24,7 @@ _require_xfs_scratch_rmapbt _require_xfs_io_command "scrub" _require_xfs_io_error_injection "force_repair" _require_command "$KILLALL_PROG" killall +_require_freeze echo "Format and populate" _scratch_mkfs > "$seqres.full" 2>&1 diff --git a/tests/xfs/438 b/tests/xfs/438 index c3008b1c..cfe75bd8 100755 --- a/tests/xfs/438 +++ b/tests/xfs/438 @@ -21,7 +21,7 @@ # Fixed by upstream commit 373b058 ("xfs: Properly retry failed dquot # items in case of error during buffer writeback") . ./common/preamble -_begin_fstest auto quick quota +_begin_fstest auto quick quota freeze # Override the default cleanup function. _cleanup() diff --git a/tests/xfs/517 b/tests/xfs/517 index 88c4f43b..f7f9a8a2 100755 --- a/tests/xfs/517 +++ b/tests/xfs/517 @@ -29,6 +29,7 @@ _supported_fs xfs _require_xfs_scratch_rmapbt _require_xfs_io_command "fsmap" _require_command "$KILLALL_PROG" killall +_require_freeze echo "Format and populate" _scratch_mkfs > "$seqres.full" 2>&1 From patchwork Sun Jun 19 13:46:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 12886669 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 44481C43334 for ; Sun, 19 Jun 2022 13:47:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229637AbiFSNrZ (ORCPT ); Sun, 19 Jun 2022 09:47:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236357AbiFSNrK (ORCPT ); Sun, 19 Jun 2022 09:47:10 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 744CF6378 for ; Sun, 19 Jun 2022 06:47:09 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id g4so11315534wrh.11 for ; Sun, 19 Jun 2022 06:47:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CY/oNJ8EO9OsfnaLTi7yO+kVNqN3sw4e4XLEDmrhyeM=; b=W6hsGgsV9Rrya24zNST8qeezFeLOTellkMb5l3KkTBt6E1qG5Ntk1XGzZ42JAm4DBS pgL+wDC4d8HK4Rol1cDlV02vhcc6SFacqagS7VfDS8xODNzU/jUDEeLGJv4iZOOBUG+o X2P06UqdIXi0endEb0uqH/Y8v/UPDh19nYgzbq/uaHr9UYdZ6+kvvp0KpLJaJ+d0omLH 7ZV5NjJ+D5UHD16j+RfCtZr2gH73/WVBXV9Mw0A82dk+7k6wHsQ2HTwzo+1Rlvu13Uio SrWL5sUVCH5GOzjaLAa7cgkqSt/L+cM49Cj/DVK1Edvf//6kFzT+mhAHAw6UwFHZQFJR GF/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CY/oNJ8EO9OsfnaLTi7yO+kVNqN3sw4e4XLEDmrhyeM=; b=VAiakzYF+RF3tR4VGX+PZzbiFzVCIteJinJdGpIHVJjldQ90Ib59Fh3KIWvERNa/BA b8dtt1RzLZT0aJq8uVN6OdXboAxu5NeEsciu89QqcMY9+/nOSxFMirQv3hjJ/0qOhTUt FAOVQ3SxZQZVVSGLneIQlLWePQbVZltBsTqvWGFD7f0iSofYLfUZl536PfZ8b0KFQo6f XHM2ldWltzy9CPK6mrrIdYkgGvNd9/MdElXfo9KU6aFhwAZKYVMXTfVMX/BMyybofuFE VHU/4BumCgvTwhGsR75VAWKX5bZzc1DsignzOGrPx965mehIkrZAew720OUmXxgkjrRx QeYA== X-Gm-Message-State: AJIora+o+BlgjWmi06FZoKVLryHl31gMH2ZTb++50SZIv8ihaPH905kT lHsu/FViv4lQkhmmWAIW5iI= X-Google-Smtp-Source: AGRyM1sL/Z+M4APAHrLgecFyORMTpGHtIMNIIXDCzTUn+eC4Tpr6dPpGR36BAG3jACndy9L4zfzorg== X-Received: by 2002:adf:ebc4:0:b0:21b:815b:d135 with SMTP id v4-20020adfebc4000000b0021b815bd135mr10654007wrn.653.1655646428050; Sun, 19 Jun 2022 06:47:08 -0700 (PDT) Received: from localhost.localdomain ([77.137.66.49]) by smtp.gmail.com with ESMTPSA id q18-20020adfcd92000000b00219e77e489fsm5240927wrj.17.2022.06.19.06.47.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jun 2022 06:47:07 -0700 (PDT) From: Amir Goldstein To: Zorro Lang Cc: "Darrick J . Wong" , Dave Chinner , fstests@vger.kernel.org Subject: [PATCH 2/4] fstests: make sure to unfreeze test and scratch mounts Date: Sun, 19 Jun 2022 16:46:55 +0300 Message-Id: <20220619134657.1846292-3-amir73il@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220619134657.1846292-1-amir73il@gmail.com> References: <20220619134657.1846292-1-amir73il@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org Almost all of the tests that _require_freeze() fail to unfreeze scratch mount in case the test is interrupted while fs is frozen. Move the handling of unfreeze to generic check code. For now, tests only freeze scratch fs, but to be more robust, unfreeze both test and scratch fs following a call to _require_freeze(). Tests could still hang if thier private _cleanup() routine tries to modify the frozen fs or wait for a blocked process. Fix the _cleanup() routine of xfs/011 to avoid that. Signed-off-by: Amir Goldstein --- check | 14 ++++++++------ common/rc | 5 +++-- tests/generic/390 | 2 -- tests/xfs/011 | 2 -- tests/xfs/517 | 1 - 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/check b/check index de11b37e..d6ee71aa 100755 --- a/check +++ b/check @@ -527,17 +527,21 @@ _check_filesystems() { local ret=0 + # Make sure both test and scratch are unfrozen post _require_freeze() + if [ -f ${RESULT_DIR}/require_freeze ]; then + xfs_freeze -u "$TEST_DIR" >/dev/null 2>&1 + xfs_freeze -u "$SCRATCH_MNT" >/dev/null 2>&1 + fi if [ -f ${RESULT_DIR}/require_test ]; then _check_test_fs || ret=1 - rm -f ${RESULT_DIR}/require_test* else _test_unmount 2> /dev/null fi if [ -f ${RESULT_DIR}/require_scratch ]; then _check_scratch_fs || ret=1 - rm -f ${RESULT_DIR}/require_scratch* fi _scratch_unmount 2> /dev/null + rm -f ${RESULT_DIR}/require_* return $ret } @@ -783,8 +787,7 @@ function run_section() seqres="$REPORT_DIR/$seqnum" mkdir -p $RESULT_DIR - rm -f ${RESULT_DIR}/require_scratch* - rm -f ${RESULT_DIR}/require_test* + rm -f ${RESULT_DIR}/require_* echo -n "$seqnum" if $showme; then @@ -882,8 +885,7 @@ function run_section() _dump_err_cont "[failed, exit status $sts]" _test_unmount 2> /dev/null _scratch_unmount 2> /dev/null - rm -f ${RESULT_DIR}/require_test* - rm -f ${RESULT_DIR}/require_scratch* + rm -f ${RESULT_DIR}/require_* err=true else # The test apparently passed, so check for corruption diff --git a/common/rc b/common/rc index 3c072c16..b87dfe05 100644 --- a/common/rc +++ b/common/rc @@ -1540,8 +1540,7 @@ _notrun() { echo "$*" > $seqres.notrun echo "$seq not run: $*" - rm -f ${RESULT_DIR}/require_test* - rm -f ${RESULT_DIR}/require_scratch* + rm -f ${RESULT_DIR}/require_* status=0 exit @@ -3648,6 +3647,8 @@ _require_freeze() local result=$? xfs_freeze -u "$TEST_DIR" >/dev/null 2>&1 [ $result -eq 0 ] || _notrun "$FSTYP does not support freezing" + # Make sure both test and scratch are unfrozen at the end of the test + touch ${RESULT_DIR}/require_freeze } # Does NFS export work on this fs? diff --git a/tests/generic/390 b/tests/generic/390 index 20c66e22..0f2b86fa 100755 --- a/tests/generic/390 +++ b/tests/generic/390 @@ -14,8 +14,6 @@ _begin_fstest auto freeze stress _cleanup() { cd / - # Make sure $SCRATCH_MNT is unfreezed - xfs_freeze -u $SCRATCH_MNT 2>/dev/null rm -f $tmp.* } diff --git a/tests/xfs/011 b/tests/xfs/011 index d6e9099e..351a574e 100755 --- a/tests/xfs/011 +++ b/tests/xfs/011 @@ -17,9 +17,7 @@ _begin_fstest auto freeze log metadata quick _cleanup() { $KILLALL_PROG -9 fsstress 2>/dev/null - wait cd / - _scratch_unmount 2>/dev/null rm -f $tmp.* } diff --git a/tests/xfs/517 b/tests/xfs/517 index f7f9a8a2..961668e3 100755 --- a/tests/xfs/517 +++ b/tests/xfs/517 @@ -15,7 +15,6 @@ _register_cleanup "_cleanup" BUS _cleanup() { cd / - $XFS_IO_PROG -x -c 'thaw' $SCRATCH_MNT > /dev/null 2>&1 rm -rf $tmp.* } From patchwork Sun Jun 19 13:46:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 12886667 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 4F5B0C43334 for ; Sun, 19 Jun 2022 13:47:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230164AbiFSNrP (ORCPT ); Sun, 19 Jun 2022 09:47:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237027AbiFSNrL (ORCPT ); Sun, 19 Jun 2022 09:47:11 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAF5C637B for ; Sun, 19 Jun 2022 06:47:10 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id o16so11337020wra.4 for ; Sun, 19 Jun 2022 06:47:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AIvvzvn8xZt2i6sbhS0mz++42KdKRJVzXAa3AW0thPQ=; b=Scf4Kf12BMV2XgmTDLxOe0ySkl0pX2SmaGr41okqJcit4G11HlP3Gbf6dpTFrgTIe1 49yZdnWTxYOVlqLVoWOOc7su/Py4tkv3XYqav1pmuccmM/bPoqza8dlLjzNFpyS60Mou gyYP58cxTHP4ufxhBuUrT4WHgxqCsCB5lbm4DMXUVUss9ccmKePMayrFZgh33vtagAM6 13RW3SrDanxPGQg/V9DRZXPtHH5hkIYYKa8siBiwBw3FGHVz9jR3UqvuTrjQCCLJ8Gg4 ELq2JdSVHHsMhVj74wXp4n9A+b9PxQFUGwg5N/K9aLe3lzEDmjkzMHDJi4V+E4cHUkpT Wh4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AIvvzvn8xZt2i6sbhS0mz++42KdKRJVzXAa3AW0thPQ=; b=E1Jw9qCAvHXrvNQGYdyLkUPZ1VebJhHVVoLiaAmFglvA0aACxONwE8Sz+qkppzVr7v /GzRVPlqpyhf2eRnhLmvh2g/MUeHuA6le+fIuXsi0/BKVEWuiFGDp9M+AYQpaCfRweac MS8ATwhGglB/l2OzVzlK4eAgkqGGw6UvUuMAHQrwOs/CJ+scZov5gyzKZrngiq1pJzIb jSNiD5QHGPoLqtM2U9nNANPrSH5EY09Hs2f9xzdKoshwh9hZ19AU35Qb1ZzgkFPmfWWd Lk5jEE010x9RMRZieF+TUVs8SEZ40Fm4qb+TXjqlg7Fq+fI2frcek4bR3cKGdLLT+kTp H6dg== X-Gm-Message-State: AJIora/mOdyFODiwTANuFYIeiD4Bfr90MeQCT3vRM4+JDGxSWucGroC7 E8JMNtkD1ttVMnFJUZuMnzA= X-Google-Smtp-Source: AGRyM1tv4H5lr8t7BY5bdVziokMBXLP316yjiApUc9t5YEbzC+BXxkq01y+3muyLVRVoCvhyWNY5jg== X-Received: by 2002:a5d:5941:0:b0:21a:342d:510f with SMTP id e1-20020a5d5941000000b0021a342d510fmr16375097wri.700.1655646429251; Sun, 19 Jun 2022 06:47:09 -0700 (PDT) Received: from localhost.localdomain ([77.137.66.49]) by smtp.gmail.com with ESMTPSA id q18-20020adfcd92000000b00219e77e489fsm5240927wrj.17.2022.06.19.06.47.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jun 2022 06:47:08 -0700 (PDT) From: Amir Goldstein To: Zorro Lang Cc: "Darrick J . Wong" , Dave Chinner , fstests@vger.kernel.org Subject: [PATCH 3/4] xfs/{422,517}: add missing killall to _cleanup() Date: Sun, 19 Jun 2022 16:46:56 +0300 Message-Id: <20220619134657.1846292-4-amir73il@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220619134657.1846292-1-amir73il@gmail.com> References: <20220619134657.1846292-1-amir73il@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org Those tests failed to cleanup background jobs after test is interrupted. Signed-off-by: Amir Goldstein --- tests/xfs/422 | 8 ++++++++ tests/xfs/517 | 1 + 2 files changed, 9 insertions(+) diff --git a/tests/xfs/422 b/tests/xfs/422 index a83a66df..8e9a3576 100755 --- a/tests/xfs/422 +++ b/tests/xfs/422 @@ -13,6 +13,14 @@ _begin_fstest dangerous_scrub dangerous_online_repair freeze _register_cleanup "_cleanup" BUS +# Override the default cleanup function. +_cleanup() +{ + $KILLALL_PROG -9 $XFS_IO_PROG $FSSTRESS_PROG > /dev/null 2>&1 + cd / + rm -rf $tmp.* +} + # Import common functions. . ./common/filter . ./common/fuzzy diff --git a/tests/xfs/517 b/tests/xfs/517 index 961668e3..18404248 100755 --- a/tests/xfs/517 +++ b/tests/xfs/517 @@ -14,6 +14,7 @@ _register_cleanup "_cleanup" BUS # Override the default cleanup function. _cleanup() { + $KILLALL_PROG -9 $XFS_IO_PROG $FSSTRESS_PROG > /dev/null 2>&1 cd / rm -rf $tmp.* } From patchwork Sun Jun 19 13:46:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 12886668 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 CA1E3C433EF for ; Sun, 19 Jun 2022 13:47:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230157AbiFSNrQ (ORCPT ); Sun, 19 Jun 2022 09:47:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231475AbiFSNrM (ORCPT ); Sun, 19 Jun 2022 09:47:12 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F15F06378 for ; Sun, 19 Jun 2022 06:47:11 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id s1so11323757wra.9 for ; Sun, 19 Jun 2022 06:47:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Y7mIojUzM3TQW2pFtzOR8BoJMf+4DFvFBS0HS4mtQCY=; b=ZuUkDQwVtHiahMBxgdVB3URJCgeUoltun3EmhFTQP5WiNnwqHmGSEqvyPo4ksXSD0b zRgjcF496OK+ULZQMtWkqJmhdWuwoeqr0nYw4j/zI64QO7IdetCSyi4+9eDDjYJ3WlEG nFVCtXyOzCt+dTV1DXXXWbxwiMoKQCb3iNPXC2sFeqRR/4cTcGI9XrN+qhX/Cdv98yum H8LodUDKA5OaT4jcxUm4OvirOFQs9HUI8urJdix4Ihq6GO/OB8XADDRRnrw5WNtjE1UA QT2BCw75Sn4RDR0YAh7UBOzchmkofPtwkNoTPr7Rw5yVBtutTehOoBUT+YEB3W+qGvul qSxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Y7mIojUzM3TQW2pFtzOR8BoJMf+4DFvFBS0HS4mtQCY=; b=BSoVENz+6Nq1sCPRX7o4nRbdLMXAg2dWn+CgjnQLdVYk/q6W+70xLB4xbHIHXrtxt9 ZZJM0NcNPqEiWfOyyTcrt+8L7wvSiaBWyl2j+/4UlMfXOjEdDWrXUr3b3suM3mw2iXrl BrLyKm/EJNlibsgOOC8cdjeEfLLk3IyilU32Cn4GnHgpnuoLsd6AyVuiFcp8zpekvsXu 41sNn8uUzkYo5OFOKXGAzeiwtijL3rQeQmooahpSyM4vYz1Xjldt4/uLFrsdFxZeuZX0 1m0ZSNIvLD1vvrXf7rXZYaiZXp5RhIYgz1ghM3L6hCCAXC7mFO5Yggf8W1+2KNI4bsne 582Q== X-Gm-Message-State: AJIora/biOrqj1Qz+l5lL5rYn1uHz8At5ckceUd4ICp29oAXwCoTOmHA qgqwRuDuIPYdLaV+u95FLe8= X-Google-Smtp-Source: AGRyM1tYEPC9iE3rSDE7VymVQMDv6IAacF1uwQtLRaFaR8hf3bnlcW84T5dahrUf0pvxYy1BKlm5Rw== X-Received: by 2002:a05:6000:1541:b0:219:c96a:3d3b with SMTP id 1-20020a056000154100b00219c96a3d3bmr18305001wry.393.1655646430403; Sun, 19 Jun 2022 06:47:10 -0700 (PDT) Received: from localhost.localdomain ([77.137.66.49]) by smtp.gmail.com with ESMTPSA id q18-20020adfcd92000000b00219e77e489fsm5240927wrj.17.2022.06.19.06.47.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jun 2022 06:47:10 -0700 (PDT) From: Amir Goldstein To: Zorro Lang Cc: "Darrick J . Wong" , Dave Chinner , fstests@vger.kernel.org Subject: [PATCH 4/4] xfs/{422,517}: fix false positive failure Date: Sun, 19 Jun 2022 16:46:57 +0300 Message-Id: <20220619134657.1846292-5-amir73il@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220619134657.1846292-1-amir73il@gmail.com> References: <20220619134657.1846292-1-amir73il@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org xfs/517 fails randomally with this error: QA output created by 517 Format and populate Concurrent fsmap and freeze +Terminated Test done These two test run fsstress inside the sub-shell stress_loop(), which is run as a background job. The sub-shell has an inner loop that exist after at least 30s. The outer shell, sleeps for 32s and then kills fsstress using killall. If the inner sub-shell loop does not exit before fsstress is killed, bash sub-shell prints "Terminated" to stderr and breaks golden output. There are two easy solutions to this issue: 1. The sub-shell stderr could be redirected to /dev/null or $seq.full 2. killall can use SIGINT which suppresses the "Terminated" print The tests generic/270, generic/388, generic/475, generic/648 use the first method, but that looses any other errors that fsstress may report during the inner loop. overlay/058 uses the second method (but with SIGPIPE). Use this method to preserve other reported errors. Alas, this is not enough to fix the false positive failure - the main test thread needs to also wait for the background jobs to exit. Otherwise, killall -9 in _cleanup() will cause a similar "Killed" message in stderr. Adding -w to killall requires to move it to after unfreeze, otherwise, fsstress process may be left blocked on a frozen fs and wait will not return. Signed-off-by: Amir Goldstein --- tests/xfs/422 | 5 ++++- tests/xfs/517 | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/xfs/422 b/tests/xfs/422 index 8e9a3576..63d133f8 100755 --- a/tests/xfs/422 +++ b/tests/xfs/422 @@ -95,8 +95,11 @@ while [ "$(date +%s)" -lt $((end + 2)) ]; do done # ...and clean up after the loops in case they didn't do it themselves. -$KILLALL_PROG -TERM xfs_io fsstress >> $seqres.full 2>&1 +# First thaw fs, so fsstress can exit, then kill and wait for fsstress. +# Use of SIGINT instead of SIGTERM suppresses the "Terminated" print +# from the XXX_loop() bash sub-shells $XFS_IO_PROG -x -c 'thaw' $SCRATCH_MNT >> $seqres.full 2>&1 +$KILLALL_PROG -w -SIGINT $XFS_IO_PROG $FSSTRESS_PROG >> $seqres.full 2>&1 echo "Loop finished at $(date)" >> $seqres.full echo "Test done" diff --git a/tests/xfs/517 b/tests/xfs/517 index 18404248..2f52d634 100755 --- a/tests/xfs/517 +++ b/tests/xfs/517 @@ -92,8 +92,11 @@ while [ "$(date +%s)" -lt $((end + 2)) ]; do done # ...and clean up after the loops in case they didn't do it themselves. -$KILLALL_PROG -TERM xfs_io fsstress >> $seqres.full 2>&1 +# First thaw fs, so fsstress can exit, then kill and wait for fsstress. +# Use of SIGINT instead of SIGTERM suppresses the "Terminated" print +# from the XXX_loop() bash sub-shells $XFS_IO_PROG -x -c 'thaw' $SCRATCH_MNT >> $seqres.full 2>&1 +$KILLALL_PROG -w -SIGINT $XFS_IO_PROG $FSSTRESS_PROG >> $seqres.full 2>&1 echo "Loop finished at $(date)" >> $seqres.full echo "Test done"