From patchwork Sun Feb 5 06:58:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omer Zilberberg X-Patchwork-Id: 9555921 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7871D602B1 for ; Sun, 5 Feb 2017 06:58:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 651FA26E96 for ; Sun, 5 Feb 2017 06:58:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56D1B271FD; Sun, 5 Feb 2017 06:58:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CFD1926E96 for ; Sun, 5 Feb 2017 06:58:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751812AbdBEG6Z (ORCPT ); Sun, 5 Feb 2017 01:58:25 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:37887 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751734AbdBEG6Z (ORCPT ); Sun, 5 Feb 2017 01:58:25 -0500 Received: by mail-wm0-f49.google.com with SMTP id v77so82553378wmv.0 for ; Sat, 04 Feb 2017 22:58:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plexistor-com.20150623.gappssmtp.com; s=20150623; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=73eRBr7hLuLbVvOGgQ5LuSamdeYXJyYyaYKxJeHQT7M=; b=IMEGpdnsmmXuJdXaGE4zwyylVUqf6tksj9iJfLgEAU8ydVA2Ghk909XIpdYTTdiPiW YTKlpKyiLo3oemdXmNGmm0cxYzjAOU5QO7RWbGhMTn5cmF/VIHAHgB6TtGdNsy+/mmC7 PsSav0UV2VXodY57hhJrIelLaSmFKYvIxNkiER54xkVGGXzrbVXsnSN+pgN3IbcZ+cW3 lxv9ukfjn4Maqu+EP4hXDl06Q5NFbWqkwAB1iys+M8sHFfSKAKyvXH8lcI8ZSSUDUjSY 5pNHB+o35EGtWSIr30k0+wS5IpU6wTFv3zgJGEuqlmXDlcdnfAVDOkJEAGTzoklK1hTR pXUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=73eRBr7hLuLbVvOGgQ5LuSamdeYXJyYyaYKxJeHQT7M=; b=IpEymnQxXERtrfOwj3SutodoMNA2iUtaXG7k7JZ7+kxhHrNRK4XqUPEJL6Tc2TJpNo kIlpz7REb0t/Ap+0fvG68BPEieJrtgyaFEMut8ma6xowsyEU3VFb5aquyeyJf829NtEf 72xj7ARjTvV60BCegwKzVoczWoZ9c+hWzezxtdW62gwsEIcL4+i8TLbGTYbPqMj8fL7k +zJo0cls5P3njXJJfGVjLNHb69OQWViiwuapNYad65SBT4+v23kwUXp8g4k4QtIWbVxz zuJpBA4DxLcD27zBX4S/QjswCUemQ+Ter97dY/8QeJWB6KvGvu6KZzE+bcSjj9YBJiJn ipoQ== X-Gm-Message-State: AMke39knfEqEeRfvyqLKSlYU71AjtgnyMgjN0m80hq0iR02QNscZewvNAv3WAKhDgbCHGQ== X-Received: by 10.28.135.82 with SMTP id j79mr3757796wmd.19.1486277903569; Sat, 04 Feb 2017 22:58:23 -0800 (PST) Received: from [192.168.43.93] ([2.55.156.149]) by smtp.gmail.com with ESMTPSA id 40sm53898046wry.22.2017.02.04.22.58.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Feb 2017 22:58:23 -0800 (PST) To: fstests@vger.kernel.org From: Omer Zilberberg Subject: [PATCH v2] generic/074: _cleanup potentially removes local FS files Message-ID: <60d70b3b-98ff-ac48-3d34-0a8cd0002f16@plexistor.com> Date: Sun, 5 Feb 2017 08:58:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP fstest_dir is set after _cleanup() is defined and _require_test is called. If _require_test fails (due to some unrelated bug in tested FS), _cleanup will attempt to remove $fstest_dir.*, which expands to .* This has the unfortunate effect of removing xfstests' .git and .gitignore. Here is the 074.out.bad file for this case: QA output created by 074 mount: permission denied common/rc: retrying test device mount with external set mount: permission denied common/rc: could not mount /dev/pmem0 on /mnt rm: refusing to remove '.' or '..' directory: skipping '.' rm: refusing to remove '.' or '..' directory: skipping '..' ---- The only other test which could face the same problem is generic/285. However, that test defines _cleanup after the _require* calls, and so on _require_test failure, 285.out.bad contains the harmless: ./common/rc: line 1: _cleanup: command not found Signed-off-by: Omer Zilberberg --- tests/generic/074 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/generic/074 b/tests/generic/074 index 55264bd..737b49b 100755 --- a/tests/generic/074 +++ b/tests/generic/074 @@ -28,6 +28,7 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ +fstest_dir=$TEST_DIR/fstest status=0 # success is the default! trap "_cleanup; exit \$status" 0 1 2 3 15 @@ -45,7 +46,6 @@ _supported_os IRIX Linux _require_test rm -f $seqres.full -fstest_dir=$TEST_DIR/fstest _do_test() {