From patchwork Wed Jul 4 04:50:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10505823 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 31FE8600F5 for ; Wed, 4 Jul 2018 04:51:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D70B28C77 for ; Wed, 4 Jul 2018 04:51:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 119B728C40; Wed, 4 Jul 2018 04:51:00 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, 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 007C728C40 for ; Wed, 4 Jul 2018 04:50:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932546AbeGDEu6 (ORCPT ); Wed, 4 Jul 2018 00:50:58 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:42536 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932346AbeGDEu5 (ORCPT ); Wed, 4 Jul 2018 00:50:57 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w644mPgE034646; Wed, 4 Jul 2018 04:50:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=tguaq+EwNhTCsfUdAeTWFGDGiNnGRW3Vy3dq2MtEVKU=; b=jBGQLSv30+65phNBGH/7Y9jlpVRnS249OzjpgwggLnQoykrceSZawwPgG9rPgaj5Cm2W cBtSi6LbOX7b64ZgHih00JWRDuLV7ApPqtw9957vHFxg+Ojpp1M9qTD92hOTAKLlhH2u vnx/e8Yhait1ZZVrm5kA2v+kurTZ/e4diDjaVl5AotCkA3tIdezaoIGPzp7XnnU0h6Ch hyL+ijpd8BXXWCgp1RZjQuUmnTxS1YHP06Fv8e/59/kWwSmUs0coQe606uZEtvJaKGzr JXQlhmj8MzUY0FFTw/bbebPEZt9hCj5Sb3O5pxjPM/Yp/GcU4dGvA3HoQR7kem2ZErZo Rw== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2k0dnjh8pb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 04 Jul 2018 04:50:55 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w644ot9D020452 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Jul 2018 04:50:55 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w644otWn009568; Wed, 4 Jul 2018 04:50:55 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 03 Jul 2018 21:50:54 -0700 Subject: [PATCH 1/7] generic/{279, 28[1-3]}: hide SIGBUS reporting from golden output From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 03 Jul 2018 21:50:53 -0700 Message-ID: <153067985383.28393.15559670747546571392.stgit@magnolia> In-Reply-To: <153067984748.28393.1595618163831671652.stgit@magnolia> References: <153067984748.28393.1595618163831671652.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8943 signatures=668704 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807040056 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong These four tests check that mmap'd cow writes fail when the filesystem goes down. For regular filesystems the msync reports EIO, but if quotas are enabled on xfs the write itself terminates xfs_io with a SIGBUS. We don't care how the write fails, so don't let the SIGBUS report escape to the golden output. Signed-off-by: Darrick J. Wong --- tests/generic/279 | 6 ++++++ tests/generic/281 | 6 ++++++ tests/generic/282 | 9 ++++++++- tests/generic/283 | 14 ++++++++++---- 4 files changed, 30 insertions(+), 5 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/tests/generic/279 b/tests/generic/279 index 1355c641..af699144 100755 --- a/tests/generic/279 +++ b/tests/generic/279 @@ -66,8 +66,14 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table +# Insulate ourselves against bash reporting the SIGBUS when we try to modify +# the metadata. +cat > $tmp.run << ENDL +ulimit -c 0 $XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" \ -c "msync -s 0 $filesize" $testdir/file2 >> $seqres.full 2>&1 +ENDL +bash $tmp.run 2> /dev/null _dmerror_load_working_table _dmerror_unmount _dmerror_mount diff --git a/tests/generic/281 b/tests/generic/281 index 75c4b39a..75deab7c 100755 --- a/tests/generic/281 +++ b/tests/generic/281 @@ -66,8 +66,14 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table +# Insulate ourselves against bash reporting the SIGBUS when we try to modify +# the metadata. +cat > $tmp.run << ENDL +ulimit -c 0 $XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" \ -c "msync -s 0 $filesize" $testdir/file2 >> $seqres.full 2>&1 +ENDL +bash $tmp.run 2> /dev/null echo "Clean up the mess" _dmerror_unmount diff --git a/tests/generic/282 b/tests/generic/282 index aea7ce58..44ffe278 100755 --- a/tests/generic/282 +++ b/tests/generic/282 @@ -66,7 +66,14 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table -$XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" $testdir/file2 >> $seqres.full 2>&1 +# Insulate ourselves against bash reporting the SIGBUS when we try to modify +# the metadata. +cat > $tmp.run << ENDL +ulimit -c 0 +$XFS_IO_PROG -f -c "mmap -rw 0 $filesize" \ + -c "mwrite -S 0x63 0 $filesize" $testdir/file2 >> $seqres.full 2>&1 +ENDL +bash $tmp.run 2> /dev/null _dmerror_load_working_table rm -rf $testdir/file2 >> $seqres.full 2>&1 _dmerror_unmount diff --git a/tests/generic/283 b/tests/generic/283 index 79caddb5..84a1666a 100755 --- a/tests/generic/283 +++ b/tests/generic/283 @@ -67,10 +67,16 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table -urk=$($XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" \ - -c "msync -s 0 $filesize" $testdir/file2 2>&1) -echo $urk >> $seqres.full -echo "$urk" | grep -q "error" || _fail "mwrite did not fail" +# Insulate ourselves against bash reporting the SIGBUS when we try to modify +# the metadata. +cat > $tmp.run << ENDL +ulimit -c 0 +$XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" \ + -c "msync -s 0 $filesize" $testdir/file2 2>&1 +ENDL +bash $tmp.run > $tmp.output 2>&1 +cat $tmp.output >> $seqres.full +grep -q error $tmp.output || _fail "mwrite did not fail" _dmerror_load_working_table echo "Rewrite"