From patchwork Thu Nov 1 23:19:09 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: 10664657 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 674CE14E2 for ; Thu, 1 Nov 2018 23:19:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 569042C4F4 for ; Thu, 1 Nov 2018 23:19:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4AF352C518; Thu, 1 Nov 2018 23:19:14 +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 E5BCD2C4F4 for ; Thu, 1 Nov 2018 23:19:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728088AbeKBIYP (ORCPT ); Fri, 2 Nov 2018 04:24:15 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:53878 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727749AbeKBIYP (ORCPT ); Fri, 2 Nov 2018 04:24:15 -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 wA1NJBcN087765; Thu, 1 Nov 2018 23:19:11 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=S+PWOMCne8OUyzTMNu9rlztV1si3joWs0P2mDfuw2O8=; b=27bBufaFDO023MZx6PS1akGL3zCfZ2ZWdOBsaaT//SiANo2vAvU+L4sM9Fzgksu4vNOf wssoTS1SYGwiUTszHX+IOZyrNOy+Kag5Fag+jc86EOL9r7DOLPMhIovrL582OHPGuEUo ZRVyO+XZDFpQCL/wyLJ7T1tYDVfOmrK+fJCXNxia3OtX9Qldh5WASnniLGCVOx8PVzA/ jCiZWfH803Nap1glROJNRDuYFo0i0YQcgNM9RFiaC8TQiYQGJXEOSX2tJNz429KBTt6e jc0DrXA3V8xubXP547Spl2O1aOQ55vvSeR1JtA75QKZe/ld9wZzqgCOGJ3LDU/YeZ9JO xA== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2ncgnrbq4b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Nov 2018 23:19:11 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wA1NJAS3001733 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 1 Nov 2018 23:19:10 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wA1NJAp1030777; Thu, 1 Nov 2018 23:19:10 GMT Received: from localhost (/10.145.178.77) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Nov 2018 16:19:10 -0700 Subject: [PATCH 1/8] quota: clean out speculative preallocations when checking quota usage From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Thu, 01 Nov 2018 16:19:09 -0700 Message-ID: <154111434915.6577.14047300095921080052.stgit@magnolia> In-Reply-To: <154111434286.6577.15010861884505931015.stgit@magnolia> References: <154111434286.6577.15010861884505931015.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9064 signatures=668683 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-1807170000 definitions=main-1811010194 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 On XFS, the only reliable way to clean out speculative post-eof preallocations, delayed allocations, and speculative cow preallocations is to cycle the filesystem mount. Since we're comparing the post-test quota counts against a freshly quotacheck to look for leaks, it's fine to cycle the mount. This eliminates sporadic quota count failures when running xfstests with quotas enabled. Signed-off-by: Darrick J. Wong --- common/quota | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/quota b/common/quota index 993ff5de..9309e786 100644 --- a/common/quota +++ b/common/quota @@ -260,10 +260,10 @@ _check_quota_usage() quotaon -f -u -g $SCRATCH_MNT 2>/dev/null ;; xfs) - # Clear out speculative preallocations to eliminate them - # as a source of intermittent orig/checked differences. - test -x "$XFS_SPACEMAN_PROG" && \ - "$XFS_SPACEMAN_PROG" -c 'prealloc -s' $SCRATCH_MNT + # Only way to make this reliable with cow/delalloc/speculative + # preallocations is to unmount and remount the whole mess... + _scratch_unmount + _scratch_mount "-o usrquota,grpquota" ;; *) ;;