From patchwork Wed Jul 4 04:50:30 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: 10505815 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 BA1AA601D7 for ; Wed, 4 Jul 2018 04:50:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5F7028C40 for ; Wed, 4 Jul 2018 04:50:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A71228C79; Wed, 4 Jul 2018 04:50:36 +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 378EC28C40 for ; Wed, 4 Jul 2018 04:50:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753117AbeGDEuf (ORCPT ); Wed, 4 Jul 2018 00:50:35 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:48772 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750928AbeGDEue (ORCPT ); Wed, 4 Jul 2018 00:50:34 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w644moiB066060; Wed, 4 Jul 2018 04:50:33 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=tZkJzIb9oFklG+qyq38grwp27Bnpyspwloynnb70Q5E=; b=bOgqJLV3YYdREX9wrbNS20azApw2HfkVKP+0fwoGIoegXSDbYrXgVxzd+IuN2B/DpOoE CeOrBlgwp5WDVgt8Tkiq7qWD1rUXElyhy2N+GMmwunihgAcwi29xjN3P46Y+HefRcnvO q/ZjaEG5DZmMzYBmtKSWE6tx3Wkx7agHaP4HKejfCov4nJHzPksJIadufwUiO9/TG5eF abaFaEHHGegOvaaMvxBz/tYL8Ch7iiMsis1n5kq0lrHTEhVZd2WmRvk9g2LeLCl5a5mn iPsDL62bq3kz16jWnTwoy6q7N9uLTiMcAtdEbBCWNDsnfwWnPLi1Fms3jEAT0IIPuv7E oQ== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2k0dnt18c1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 04 Jul 2018 04:50:33 +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 w644oWMf019963 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Jul 2018 04:50:32 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 w644oWZv009498; Wed, 4 Jul 2018 04:50:32 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 03 Jul 2018 21:50:31 -0700 Subject: [PATCH 1/2] generic: mread past eof shows nonzero contents 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:30 -0700 Message-ID: <153067983090.28315.5846228519830681377.stgit@magnolia> In-Reply-To: <153067982461.28315.11621030236927888645.stgit@magnolia> References: <153067982461.28315.11621030236927888645.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=824 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 Certain sequences of generic/127 invocations complain about being able to mread nonzero contents past eof. Replicate that here as a regression test. Signed-off-by: Darrick J. Wong --- tests/generic/708 | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/708.out | 2 ++ tests/generic/group | 1 + 3 files changed, 60 insertions(+) create mode 100755 tests/generic/708 create mode 100644 tests/generic/708.out -- 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/708 b/tests/generic/708 new file mode 100755 index 00000000..5648cfcd --- /dev/null +++ b/tests/generic/708 @@ -0,0 +1,57 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2018 Oracle, Inc. All Rights Reserved. +# +# FS QA Test No. 708 +# +# Test a specific sequence of fsx operations that causes an mmap read past +# eof to return nonzero contents. +# +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/punch + +# real QA test starts here +_supported_fs generic +_supported_os Linux +_require_scratch +_require_xfs_io_command "fcollapse" +_require_xfs_io_command "fzero" + +rm -f $seqres.full + +_scratch_mkfs >>$seqres.full 2>&1 +_scratch_mount + +cat >> $tmp.fsxops << ENDL +fallocate 0x77e2 0x5f06 0x269a2 keep_size +mapwrite 0x2e7fc 0x42ba 0x3f989 +write 0x67a9 0x714e 0x3f989 +write 0x39f96 0x185a 0x3f989 +collapse_range 0x36000 0x8000 0x3f989 +mapread 0x74c0 0x1bb3 0x3e2d0 +truncate 0x0 0x8aa2 0x3e2d0 +zero_range 0x1265 0x783d 0x8aa2 +mapread 0x7bd8 0xeca 0x8aa2 +ENDL + +victim=$SCRATCH_MNT/a +touch $victim +$here/ltp/fsx --replay-ops $tmp.fsxops $victim > $tmp.output || cat $tmp.output + +echo "Silence is golden" +status=0 +exit diff --git a/tests/generic/708.out b/tests/generic/708.out new file mode 100644 index 00000000..33c478ad --- /dev/null +++ b/tests/generic/708.out @@ -0,0 +1,2 @@ +QA output created by 708 +Silence is golden diff --git a/tests/generic/group b/tests/generic/group index 83a6fdab..eb3a0dd0 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -501,3 +501,4 @@ 496 auto quick swap 497 auto quick swap collapse 498 auto quick log +708 auto quick rw collapse zero