From patchwork Wed Dec 7 00:18:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 9463589 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 4791160459 for ; Wed, 7 Dec 2016 00:18:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39286284D0 for ; Wed, 7 Dec 2016 00:18:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C71D284F2; Wed, 7 Dec 2016 00:18:57 +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.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY 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 C38C7284D0 for ; Wed, 7 Dec 2016 00:18:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753225AbcLGAS4 (ORCPT ); Tue, 6 Dec 2016 19:18:56 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:29421 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752646AbcLGASz (ORCPT ); Tue, 6 Dec 2016 19:18:55 -0500 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uB70IqFs025766 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 7 Dec 2016 00:18:53 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id uB70Iq2S019712 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 7 Dec 2016 00:18:52 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id uB70IoKc025466; Wed, 7 Dec 2016 00:18:51 GMT Received: from localhost (/24.21.211.40) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 06 Dec 2016 16:18:50 -0800 Subject: [PATCH 06/11] populate: fix some silly errors when modifying a fs while fuzzing From: "Darrick J. Wong" To: david@fromorbit.com, eguan@redhat.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 06 Dec 2016 16:18:49 -0800 Message-ID: <148106992913.19334.7386542666559072356.stgit@birch.djwong.org> In-Reply-To: <148106989109.19334.6839386416313318071.stgit@birch.djwong.org> References: <148106989109.19334.6839386416313318071.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There were some silly errors in _scratch_fuzz_modify such that it wasn't really doing much of anything because of undefined variables. (Sloppy refactoring when converting xfsfuzz.sh into xfstests.) Signed-off-by: Darrick J. Wong --- common/populate | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/common/populate b/common/populate index 2385c8d..5227cd1 100644 --- a/common/populate +++ b/common/populate @@ -596,7 +596,7 @@ _scratch_populate() { _scratch_xfs_populate _scratch_xfs_populate_check ;; - "ext4") + "ext2"|"ext3"|"ext4") _scratch_ext4_populate _scratch_ext4_populate_check ;; @@ -612,22 +612,24 @@ _scratch_fuzz_modify() { test -z "${nr}" && nr=50000 echo "+++ touch ${nr} files" - $XFS_IO_PROG -f -c "pwrite -S 0x63 0 ${BLK_SZ}" "/tmp/afile" > /dev/null + blk_sz=$(stat -f -c '%s' ${SCRATCH_MNT}) + $XFS_IO_PROG -f -c "pwrite -S 0x63 0 ${blk_sz}" "/tmp/afile" > /dev/null date="$(date)" find "${SCRATCH_MNT}/" -type f 2> /dev/null | head -n "${nr}" | while read f; do setfattr -n "user.date" -v "${date}" "$f" cat "/tmp/afile" >> "$f" mv "$f" "$f.longer" done + sync rm -rf "/tmp/afile" echo "+++ create files" - cp -pRdu "${SRCDIR}" "${SCRATCH_MNT}/test.moo" + mkdir -p "${SCRATCH_MNT}/test.moo" + $XFS_IO_PROG -f -c 'pwrite -S 0x80 0 65536' "${SCRATCH_MNT}/test.moo/urk" sync echo "+++ remove files" rm -rf "${SCRATCH_MNT}/test.moo" - rm -rf "${SCRATCH_MNT}/test.1" } # Try to access files after fuzzing