From patchwork Sun Oct 16 10:53:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9378083 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 3DCD2600CA for ; Sun, 16 Oct 2016 10:54:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E8F228C57 for ; Sun, 16 Oct 2016 10:54:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21FFB28C94; Sun, 16 Oct 2016 10:54:19 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, LOTS_OF_MONEY, 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 8883E28C57 for ; Sun, 16 Oct 2016 10:54:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755445AbcJPKyS (ORCPT ); Sun, 16 Oct 2016 06:54:18 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:34204 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752904AbcJPKyR (ORCPT ); Sun, 16 Oct 2016 06:54:17 -0400 Received: by mail-lf0-f66.google.com with SMTP id x23so15201396lfi.1 for ; Sun, 16 Oct 2016 03:54:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3bcCLdM0iZVX6S+DKfk4VksV1ufVwT1Cu0eXolgegwA=; b=ENZrSRZy9x5Z6q9vktQ2XQIr93kGUlSavEL/RkvupP6smC0h73K8hhCuyBOyO21SiP uI6WW0trahoAoQNDD+1ewJ8W8y+Lsp3Dy8tfv6ZTTK2Pc2Zb3T0awS+Qd2V6LHyExYQ+ twOb6lF7pY/bEwrHJVSespp2jJZqZN37G4Cf6iXZZ4RSHRlRCxPs1vqVpZXcU1WCr2JD Ak12fIVy/U9ZcDS6IhtsjiniVJhSWqEM4nebfLpafBhuapIL0p1CmKL0oe3jyj+7IEkp Azi3IKPdrShY0M4Vjx/zayseD71jdLmE7+P7eJestBGxDkzwNc7BKIGMPalMIfZW0Mc/ 9vhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3bcCLdM0iZVX6S+DKfk4VksV1ufVwT1Cu0eXolgegwA=; b=jyJSYE3Jo9bggMRnIPHMR3S9cLd9Pxzt+CHeiSWUC/nswj/KAo+GjbZV7YeCt0SFil h5T8PJfoZcGbT1lmYH1u5/zuQxv8VTff5HyLvsCKBV4jFTKpWaw2qntXZVESVgpqBhCI hFy667PKD4L4zRvcDGbNgiUfXEDrF+2RDRCbUUZJ/wAypfXRroz7iJQjScClEsPwkDG6 lU6mEf4zTaU2RvOK/QsWLZrEbVhMOt5pcZ3xoRCyziPjn4i0wVsepUVbtvDVw19UTov9 WG/teu9LgK5xxncjTjc3kTg0kXUbXaXKkX0ZLA8A5z/BOq2zLSi3ITCEoMswzz51fLII t6hQ== X-Gm-Message-State: AA6/9RkI0iWbbnuSNTEm33kaPqtI4Rho82fVGXMYv9BRj/6eLULOnznxpSwm7gtWiiUkHQ== X-Received: by 10.28.7.198 with SMTP id 189mr5316515wmh.65.1476615255165; Sun, 16 Oct 2016 03:54:15 -0700 (PDT) Received: from amir-VirtualBox.Home (bzq-79-177-34-153.red.bezeqint.net. [79.177.34.153]) by smtp.gmail.com with ESMTPSA id q8sm41269099wjj.7.2016.10.16.03.54.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 16 Oct 2016 03:54:13 -0700 (PDT) From: Amir Goldstein To: Dave Chinner , Eryu Guan , Christoph Hellwig Cc: "Darrick J . Wong" , fstests@vger.kernel.org Subject: [PATCH v2 2/3] fstests: strip quotes from "$XFS_IO_PROG" call sites Date: Sun, 16 Oct 2016 13:53:41 +0300 Message-Id: <1476615222-7804-2-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476615222-7804-1-git-send-email-amir73il@gmail.com> References: <1476615222-7804-1-git-send-email-amir73il@gmail.com> Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The value of "$XFS_IO_PROG" may contain extra flags after the binary path (e.g. -F), so it is wrong to use the variable inside quotes in xfs_io execution call sites. This bug surfaced while testing the new xfs_io -M flag. Signed-off-by: Amir Goldstein --- common/rc | 6 +++--- common/reflink | 26 +++++++++++++------------- tests/generic/176 | 2 +- tests/xfs/328 | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/common/rc b/common/rc index 565ba67..a838750 100644 --- a/common/rc +++ b/common/rc @@ -90,7 +90,7 @@ _pwrite_byte() { file="$4" xfs_io_args="$5" - "$XFS_IO_PROG" $xfs_io_args -f -c "pwrite -S $pattern $offset $len" "$file" + $XFS_IO_PROG $xfs_io_args -f -c "pwrite -S $pattern $offset $len" "$file" } # mmap-write a byte into a range of a file @@ -101,7 +101,7 @@ _mwrite_byte() { mmap_len="$4" file="$5" - "$XFS_IO_PROG" -f -c "mmap -rw 0 $mmap_len" -c "mwrite -S $pattern $offset $len" "$file" + $XFS_IO_PROG -f -c "mmap -rw 0 $mmap_len" -c "mwrite -S $pattern $offset $len" "$file" } # ls -l w/ selinux sometimes puts a dot at the end: @@ -3437,7 +3437,7 @@ _xfs_bmapx_find() { file="$1" shift - "$XFS_IO_PROG" -c "bmap -${param}lpv" "$file" | grep -c "$@" + $XFS_IO_PROG -c "bmap -${param}lpv" "$file" | grep -c "$@" } _require_chattr() diff --git a/common/reflink b/common/reflink index 1363971..8b34046 100644 --- a/common/reflink +++ b/common/reflink @@ -52,8 +52,8 @@ _require_test_reflink() _require_xfs_io_command "reflink" rm -rf "$TEST_DIR/file1" "$TEST_DIR/file2" - "$XFS_IO_PROG" -f -c "pwrite -S 0x61 0 65536" "$TEST_DIR/file1" > /dev/null - "$XFS_IO_PROG" -f -c "reflink $TEST_DIR/file1 0 0 65536" "$TEST_DIR/file2" > /dev/null + $XFS_IO_PROG -f -c "pwrite -S 0x61 0 65536" "$TEST_DIR/file1" > /dev/null + $XFS_IO_PROG -f -c "reflink $TEST_DIR/file1 0 0 65536" "$TEST_DIR/file2" > /dev/null if [ ! -s "$TEST_DIR/file2" ]; then rm -rf "$TEST_DIR/file1" "$TEST_DIR/file2" _notrun "Reflink not supported by test filesystem type: $FSTYP" @@ -69,8 +69,8 @@ _require_scratch_reflink() _scratch_mkfs > /dev/null _scratch_mount - "$XFS_IO_PROG" -f -c "pwrite -S 0x61 0 65536" "$SCRATCH_MNT/file1" > /dev/null - "$XFS_IO_PROG" -f -c "reflink $SCRATCH_MNT/file1 0 0 65536" "$SCRATCH_MNT/file2" > /dev/null + $XFS_IO_PROG -f -c "pwrite -S 0x61 0 65536" "$SCRATCH_MNT/file1" > /dev/null + $XFS_IO_PROG -f -c "reflink $SCRATCH_MNT/file1 0 0 65536" "$SCRATCH_MNT/file2" > /dev/null if [ ! -s "$SCRATCH_MNT/file2" ]; then _scratch_unmount _notrun "Reflink not supported by scratch filesystem type: $FSTYP" @@ -85,9 +85,9 @@ _require_test_dedupe() _require_xfs_io_command "dedupe" rm -rf "$TEST_DIR/file1" "$TEST_DIR/file2" - "$XFS_IO_PROG" -f -c "pwrite -S 0x61 0 65536" "$TEST_DIR/file1" > /dev/null - "$XFS_IO_PROG" -f -c "pwrite -S 0x61 0 65536" "$TEST_DIR/file2" > /dev/null - testio="$("$XFS_IO_PROG" -f -c "dedupe $TEST_DIR/file1 0 0 65536" "$TEST_DIR/file2" 2>&1)" + $XFS_IO_PROG -f -c "pwrite -S 0x61 0 65536" "$TEST_DIR/file1" > /dev/null + $XFS_IO_PROG -f -c "pwrite -S 0x61 0 65536" "$TEST_DIR/file2" > /dev/null + testio="$($XFS_IO_PROG -f -c "dedupe $TEST_DIR/file1 0 0 65536" "$TEST_DIR/file2" 2>&1)" echo $testio | grep -q "Operation not supported" && \ _notrun "Dedupe not supported by test filesystem type: $FSTYP" echo $testio | grep -q "Inappropriate ioctl for device" && \ @@ -105,9 +105,9 @@ _require_scratch_dedupe() _scratch_mkfs > /dev/null _scratch_mount - "$XFS_IO_PROG" -f -c "pwrite -S 0x61 0 65536" "$SCRATCH_MNT/file1" > /dev/null - "$XFS_IO_PROG" -f -c "pwrite -S 0x61 0 65536" "$SCRATCH_MNT/file2" > /dev/null - testio="$("$XFS_IO_PROG" -f -c "dedupe $SCRATCH_MNT/file1 0 0 65536" "$SCRATCH_MNT/file2" 2>&1)" + $XFS_IO_PROG -f -c "pwrite -S 0x61 0 65536" "$SCRATCH_MNT/file1" > /dev/null + $XFS_IO_PROG -f -c "pwrite -S 0x61 0 65536" "$SCRATCH_MNT/file2" > /dev/null + testio="$($XFS_IO_PROG -f -c "dedupe $SCRATCH_MNT/file1 0 0 65536" "$SCRATCH_MNT/file2" 2>&1)" echo $testio | grep -q "Operation not supported" && \ _notrun "Dedupe not supported by test filesystem type: $FSTYP" echo $testio | grep -q "Inappropriate ioctl for device" && \ @@ -161,7 +161,7 @@ _reflink() { file1="$1" file2="$2" - "$XFS_IO_PROG" -f -c "reflink $file1" "$file2" + $XFS_IO_PROG -f -c "reflink $file1" "$file2" } # Reflink some part of file1 into another part of file2 @@ -173,7 +173,7 @@ _reflink_range() { len="$5" xfs_io_args="$6" - "$XFS_IO_PROG" $xfs_io_args -f -c "reflink $file1 $offset1 $offset2 $len" "$file2" + $XFS_IO_PROG $xfs_io_args -f -c "reflink $file1 $offset1 $offset2 $len" "$file2" } # Dedupe some part of file1 into another part of file2 @@ -185,7 +185,7 @@ _dedupe_range() { len="$5" xfs_io_args="$6" - "$XFS_IO_PROG" $xfs_io_args -f -c "dedupe $file1 $offset1 $offset2 $len" "$file2" + $XFS_IO_PROG $xfs_io_args -f -c "dedupe $file1 $offset1 $offset2 $len" "$file2" } # Create a file of interleaved unwritten and reflinked blocks diff --git a/tests/generic/176 b/tests/generic/176 index b14255b..76e923a 100755 --- a/tests/generic/176 +++ b/tests/generic/176 @@ -75,7 +75,7 @@ test $fnr -lt 17 && _notrun "Insufficient space for stress test; would only crea echo "Create a many-block file" echo "creating $blocks_needed blocks..." >> "$seqres.full" -"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b 4194304 0 $((2 ** (fnr + 1) * blksz))" "$testdir/file1" >> "$seqres.full" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b 4194304 0 $((2 ** (fnr + 1) * blksz))" "$testdir/file1" >> "$seqres.full" echo "punching..." >> "$seqres.full" "$here/src/punch-alternating" "$testdir/file1" >> "$seqres.full" echo "...done" >> "$seqres.full" diff --git a/tests/xfs/328 b/tests/xfs/328 index 33a0bef..8518456 100755 --- a/tests/xfs/328 +++ b/tests/xfs/328 @@ -80,7 +80,7 @@ bytes=$((blocks_needed * blksz)) echo "Create a many-block file" echo "creating $blocks_needed blocks..." >> "$seqres.full" _pwrite_byte 0x62 0 $blksz $testdir/file0 >> $seqres.full -"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b 4194304 0 $bytes" "$testdir/file1" >> "$seqres.full" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b 4194304 0 $bytes" "$testdir/file1" >> "$seqres.full" echo "punching..." >> "$seqres.full" "$here/src/punch-alternating" "$testdir/file1" >> "$seqres.full" seq 0 2 $((2 ** (fnr + 1) )) | while read lblk; do