From patchwork Thu Jun 21 18:32:49 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: 10480387 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 04AF9604D3 for ; Thu, 21 Jun 2018 18:32:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E16E229196 for ; Thu, 21 Jun 2018 18:32:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5A942919C; Thu, 21 Jun 2018 18:32:54 +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 6A73D29196 for ; Thu, 21 Jun 2018 18:32:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754131AbeFUScy (ORCPT ); Thu, 21 Jun 2018 14:32:54 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:41168 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754012AbeFUScx (ORCPT ); Thu, 21 Jun 2018 14:32:53 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w5LITHuv147120; Thu, 21 Jun 2018 18:32:51 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=wH/vFJwO/D0Z3wgbAlD/gB22B6qA+sXkgm/SaBVvw50=; b=szAHdq1UK1KDYhNln6KKosUE1G+c3y3We8B9GzLmEKzbIgE/L7ZHoONkZkFsVI0+nWxk PyLA2N7vIHUbkqL+P1hk5vFxjUOflMU/CefAdp/k3K7G+XVc1F8xlLGVEqFs96Bg0QWC xc79YU0WCm5GV7Cc66e7CgXUdLGMdSEaG+3TbJOkLYZwLgY+ZOCu5Rw842XC0OzcRkOa qiznLPn6LFihbWkZjQfo++HcGIrbppfJ8kdWyqlJrhdvCZ0CQYwEFDv2q4lWW8XP6piz 2WZb1c2kdTHlspFnaPmeh94XS+uAx8anwqA6vo+prj4tfYhRLSFm/HqM+3vQNRq4go3p wg== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2jmt01u7tu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 Jun 2018 18:32:51 +0000 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 w5LIWoaS006790 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 Jun 2018 18:32:51 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w5LIWonX029406; Thu, 21 Jun 2018 18:32:50 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 21 Jun 2018 11:32:50 -0700 Subject: [PATCH 3/4] 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: Thu, 21 Jun 2018 11:32:49 -0700 Message-ID: <152960596951.26479.121617216998011751.stgit@magnolia> In-Reply-To: <152960594943.26479.1457883867468749220.stgit@magnolia> References: <152960594943.26479.1457883867468749220.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8931 signatures=668703 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=710 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806210199 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 | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/708.out | 2 ++ tests/generic/group | 1 + 3 files changed, 57 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..d380053f --- /dev/null +++ b/tests/generic/708 @@ -0,0 +1,54 @@ +#! /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 + +# real QA test starts here +_supported_fs generic +_supported_os Linux +_require_scratch + +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..1a1a0a6e 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