From patchwork Wed Mar 20 00:45:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10860617 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3BD181515 for ; Wed, 20 Mar 2019 00:45:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1743528500 for ; Wed, 20 Mar 2019 00:45:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08F172998B; Wed, 20 Mar 2019 00:45:06 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 A887328500 for ; Wed, 20 Mar 2019 00:45:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727405AbfCTApF (ORCPT ); Tue, 19 Mar 2019 20:45:05 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:57194 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726969AbfCTApF (ORCPT ); Tue, 19 Mar 2019 20:45:05 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2K0cYIP008235; Wed, 20 Mar 2019 00:45:03 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-2018-07-02; bh=bDQwWzZNhJt6dClJIdd269bZOBf0vrFVHuzsc5VzPPc=; b=qcph92gyvs5uTqKRBn65xckC8kgpDxAcvAzChkHzUy/GBLMPn0s6Zenw/hs9lNL7aUEo l1bWk706gG8JF0d4XIVAEgGuP5ffqtaycP5A57wpC57SVm3nuM7QxAi+cwZYXUfPPtKs 1/q9JBUYnep3+5Sf9NIghpq8lBFs+mb0OoDeV1bvXexnMF57tirNp36ywUqDNdJAZxQq soO10Y8f8cPqQlXMQvteICDLDH7PwefmE3qx5ckH1qEHu+jFhvN9QuUGFffu8HUhPb/j 5g3HcgMmXskLOLOrC/65BBY/0sv+Jr7/Gbwn4KNsB/pQxvO9S7MJZ5GHJFhNO6CvAPGz HQ== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2r8pner3x1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:45:02 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x2K0j2Lv014652 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:45:02 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x2K0j1DT006802; Wed, 20 Mar 2019 00:45:01 GMT Received: from localhost (/10.159.245.168) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Mar 2019 17:45:01 -0700 Subject: [PATCH 04/12] generic/032: fix unwritten extent checks From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 19 Mar 2019 17:45:01 -0700 Message-ID: <155304270155.31707.5574383689968895450.stgit@magnolia> In-Reply-To: <155304267647.31707.14180452399822113095.stgit@magnolia> References: <155304267647.31707.14180452399822113095.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9200 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903200003 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 Fix the unwritten extent detector in this test to ignore post-eof allocations because those are harmless. Signed-off-by: Darrick J. Wong --- tests/generic/032 | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/generic/032 b/tests/generic/032 index affde4b7..38352a21 100755 --- a/tests/generic/032 +++ b/tests/generic/032 @@ -69,18 +69,21 @@ do # preallocate the first 64k and overwite, writing past 64k to contend # with writeback + file_len=0x100000 $XFS_IO_PROG \ -c "falloc 0 0x10000" \ - -c "pwrite 0 0x100000" \ + -c "pwrite 0 $file_len" \ -c "fsync" \ $SCRATCH_MNT/file >> $seqres.full 2>&1 - # Check for unwritten extents. We should have none since we wrote over - # the entire preallocated region and ran fsync. - $XFS_IO_PROG -c "fiemap -v" $SCRATCH_MNT/file | \ - tee -a $seqres.full | \ - _filter_fiemap | grep unwritten - [ $? == 0 ] && _fail "Unwritten extents found!" + # Check for unwritten extents. We should have none before EOF since we + # wrote over the entire preallocated region and ran fsync. + eof_sector=$(( file_len / 512 )) + $XFS_IO_PROG -c 'fiemap -v' $SCRATCH_MNT/file | \ + _filter_fiemap | \ + tr '[.]:' ' ' | \ + awk "{if (\$2 < $eof_sector) {print \$0}}" | \ + grep -q unwritten && _fail "Unwritten extents found!" done echo $iters iterations